Open
Description
What feature would you like to see?
Just before Crashlytics is about to send a crash report, have a callback for it.
How would you use it?
There are 2 main reasons to have it:
- To add extra details
- To be able to cancel the crash report in case it's a crash we know that can't be handled and that Crashlytics website can't mute. Example of such crashes is of "DeadSystemException" which seems to occur when Android closes many running apps due to some extreme battery optimization.
Currently the workaround is to do as such:
val defaultHandler = Thread.getDefaultUncaughtExceptionHandler()
Thread.setDefaultUncaughtExceptionHandler { th, ex ->
...
if (needToIgnoreException)
return@setDefaultUncaughtExceptionHandler
CrashlyticsUtil.reportGeneralInfo()
defaultHandler?.uncaughtException(th, ex)
}
Sadly though, this doesn't capture all of the crashes that are sent via Crashlytics.
Probably because sometimes the crashes are gathered to be sent later (no Internet, etc...)
This is why the callback should also tell us when the crash occurred on the exact same session that we send the crash.
Maybe we could have 2 callbacks: one for the crash itself, and one for the reporting of it (both allow the same functionality, including to add more information and to cancel the report).