Enable opt-in reporting
By default, Crashlytics automatically collects crash reports for all your app's users. To give users more control over the data they send, you can enable opt-in reporting for your users by disabling automatic collection and initializing Crashlytics only for selected users:
- Turn off automatic collection by adding a new key to your Info.plist file:
- Key: FirebaseCrashlyticsCollectionEnabled
- Value: false
- Enable collection for select users by calling the Crashlytics data collection override at runtime. The override value persists across launches of your app so Crashlytics can automatically collect reports. To opt out of automatic crash reporting, pass false as the override value. When set to false, the new value does not apply until the next run of the app.
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)