Disable Firebase Crash Reports

I decided to include Firebase Crash API 9.0.1 in my Android app. At the moment, everything is working fine. Now I want to give my users the ability to disable that Firebase automatically sends crash reports.

Firebase Analytics can be disabled using this code snippet.

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

Do any of you know a similar way to disable crash reports?

Thank you very much

+5
source share
3 answers

Yes, now it is possible. Check this, disable crash report

Just add the line below to your code in the first step or even better in the Application class.

 FirebaseCrash.setCrashCollectionEnabled(false); 

To turn on,

 FirebaseCrash.setCrashCollectionEnabled(true); 

This is really useful when we have several types of builds such as Debug, Release, etc.

0
source

Sorry for the short answer, but there is currently no official support for this.

EDIT: 10/30/2017

Now you can enable / disable during the build by adding to AndroidManifest.xml :

 <meta-data android:name="firebase_crash_collection_enabled" android:value="false" /> 

or runtime using:

 FirebaseCrash.enableCrash(true|false); 

More info here.

+4
source

Instructions can be found at: https://firebase.google.com/support/guides/disable-analytics

Disable the Google Analytics Collection on Android

Temporarily disable a collection

If you want to temporarily disable the Google Analytics collection, for example, to obtain end-user consent before collecting data, you can set the firebase_analytics_collection_enabled value to false in the AndroidManifest.xml application in the application tag. For instance:

 <meta-data android:name="firebase_analytics_collection_enabled" android:value="false" /> 

To enable collection again, for example, after obtaining end-user consent, call the setAnalyticsCollectionEnabled () method of the FirebaseAnalytics class. For instance:

 setAnalyticsCollectionEnabled(true); 

If you need to suspend the collection again for any reason, you can call

 setAnalyticsCollectionEnabled(false); 

and collection is paused until you re-enable it.

Permanently deactivate collection

If you need to deactivate the Google Analytics collection permanently in the version of your application, set firebase_analytics_collection_deactivated to true in the AndroidManifest.xml application in the application tag. For instance:

 <meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" /> 
-2
source

All Articles