Search code examples
androidfirebasefirebase-crash-reporting

Disable Firebase crash reporting


I have decided to include the Firebase Crash API 9.0.1 into my Android app. At the moment everything is working fine. Now I want to give my users the opportunity to disable, that Firebase is sending the Crash reports automatically.

Firebase Analytics can be disabled with this code snippet

FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(false);

Does anyone of you know a similar way to disable crash reporting?

Many thanks


Solution

  • Yes it is possible now. Check this, Disable Crash Reporting

    Simply add the below line to your code in the first activity or even better in the Application class.

    FirebaseCrash.setCrashCollectionEnabled(false);
    

    To enable,

    FirebaseCrash.setCrashCollectionEnabled(true);
    

    This is really helpful when we have multiple build types such as Debug, Release etc.