Raj Aggrawal
Raj Aggrawal

Reputation: 761

How to disable crash reporting in while app is in background state in iOS

Firebase crashlytics is integrated into my application and working fine. I am experiencing crashes while the app is in the background and I wanted to disable these crash reporting but other crashes must be reported.

Upvotes: 0

Views: 734

Answers (1)

Arik Segal
Arik Segal

Reputation: 3031

Follow the instructions from:

enabling/disabling Crashlytics at runtime in iOS app

Add this key value to your info.plist:

Key: FirebaseCrashlyticsCollectionEnabled 
Value: false 

You can then manually enable or disable crash reporting by using this method:

 Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)

So now you can enable Crashlytics when the app is launched, disable it when applicationDidEnterBackground is triggered and re-enable it when applicationWillEnterForeground is trigerred.

Upvotes: 1

Related Questions