Skip to content

Commit

Permalink
update : adding ACRA Crash Report
Browse files Browse the repository at this point in the history
  • Loading branch information
amirisback committed Mar 27, 2024
1 parent ce491ce commit c54c1fc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
4 changes: 4 additions & 0 deletions core-sdk-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ dependencies {
ksp(Androidx.Lifecycle.compiler)
ksp(Androidx.Room.compiler)
ksp(GitHub.glideCompiler)
api("ch.acra:acra-mail:5.11.3")

ksp("com.google.auto.service:auto-service:1.1.1")
compileOnly("com.google.auto.service:auto-service-annotations:1.1.1")

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import android.app.Activity
import android.app.Application
import cat.ereza.customactivityoncrash.config.CaocConfig
import com.frogobox.sdk.ui.FrogoCustomCrashActivity
import org.acra.config.mailSender
import org.acra.data.StringFormat
import org.acra.ktx.initAcra


/**
Expand All @@ -23,10 +26,6 @@ abstract class FrogoApplication : Application() {

open fun onCreateExt() {}

open fun customErrorActivity(): Class<out Activity> {
return FrogoCustomCrashActivity::class.java
}

open fun isDebugMode(): Boolean {
return true
}
Expand All @@ -45,10 +44,31 @@ abstract class FrogoApplication : Application() {
}
}

open fun customErrorActivity(): Class<out Activity> {
return FrogoCustomCrashActivity::class.java
}

open fun setupACRA() {
initAcra {
buildConfigClass = BuildConfig::class.java
reportFormat = StringFormat.JSON
alsoReportToAndroidFramework = true
mailSender {
//required
mailTo = "faisalamircs.work@gmail.com"
//defaults to true
reportAsFile = true
//defaults to ACRA-report.stacktrace
reportFileName = "Crash.txt"
}
}
}

override fun onCreate() {
super.onCreate()
onCreateExt()
setupCAOC()
setupACRA()
}

}

0 comments on commit c54c1fc

Please sign in to comment.