firebase / firebase/firebase-android-sdk

Request: add callback for when Crashlytics is about to send a crash report

Open
#2,634 1 comment 1 reaction 0 assignees View on GitHub
api: crashlytics type: feature request
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 9h
Merged PRs (30d)
31

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:
1. To add extra details
2. 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:

```kt
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).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.