Skip to content

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

Open
@AndroidDeveloperLB

Description

@AndroidDeveloperLB

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:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions