Disable Crash Reporting

To let you users opt-in or opt-out of using Firebase Crash Reporting, you might want to configure your app so that you can enable and disable Crash Reporting. You might also find this capability to be useful during app development and testing.

If you want to let users opt-in to Crash Reporting we recommend disabling the SDK at build time, then enabling the SDK at run time after an explicit user action. You can also disable the SDK at build time to allow for a gradual roll-out of Crash Reporting through the use of Firebase Remote Config.

To enable an opt-out you can enable the SDK at build time, and then disable at runtime after a user indicates their preference using a settings screen or similar interface. Runtime preferences will persist across app restarts.

Disable Crash Reporting during your app build process

Disabling at build time means the SDK is compiled in to your app, but will not log crashes until it is programmatically enabled.

iOS

You can add a key to the Info.plist for your iOS app to disable Crash Reporting at build time.

Add the key firebase_crash_collection_enabled, and set the value to false.

Android

You can add a meta-data entry to the AndroidManifest.xml for your app to disable Crash Reporting at build time.

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

Disable or enable Crash Reporting at runtime

Disabling Crash Reporting at runtime will prevent crashes being collected until Crash Reporting is renabled. Setting this property will persist between app restarts.

iOS

To disable Crash Reporting call:

Swift

Crash.sharedInstance().crashCollectionEnabled = false

Objective-C

[FIRCrash sharedInstance].crashCollectionEnabled = NO;

To enable Crash Reporting call:

Swift

Crash.sharedInstance().crashCollectionEnabled = true

Objective-C

[FIRCrash sharedInstance].crashCollectionEnabled = YES;

Android

To disable Crash Reporting call:

FirebaseCrash.enableCrash(false);

To enable Crash Reporting call:

FirebaseCrash.enableCrash(true);

Send feedback about...

Need help? Visit our support page.