6

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

3

3 Answers 3

5

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

EDIT: 30/10/2017

Now it is possible to enable/disable at build time adding in the AndroidManifest.xml:

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

or runtime using:

FirebaseCrash.enableCrash(true|false); 

More info here.

Sign up to request clarification or add additional context in comments.

1 Comment

I can't believe this isn't available. I mean I'm going nuts looking at crashes caused by developers and not users. :/ Android is easy to simply remove the library... Maybe iOS has a way to not compile this?
1

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.

Comments

-2

You can find the instructions on the page: https://firebase.google.com/support/guides/disable-analytics

Disable Analytics collection on Android

Temporarily disable collection

If you wish to temporarily disable Analytics collection, such as to get end-user consent before collecting data, you can set the value of firebase_analytics_collection_enabled to false in your app's AndroidManifest.xml in the application tag. For example:

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

To re-enable collection, such as after an end-user provides consent, call the setAnalyticsCollectionEnabled() method of the FirebaseAnalytics class. For example:

setAnalyticsCollectionEnabled(true); 

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

setAnalyticsCollectionEnabled(false); 

and collection is suspended until you re-enable it.

Permanently deactivate collection

If you need to deactivate Analytics collection permanently in a version of your app, set firebase_analytics_collection_deactivated to true in your app's AndroidManifest.xml in the application tag. For example:

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.