setCrashlyticsCollectionEnabled method

  1. @override
Future<void> setCrashlyticsCollectionEnabled(
  1. bool enabled
)
override

Enables/disables automatic data collection by Crashlytics.

If this is set, it overrides the data collection settings provided by the Android Manifest, iOS Plist settings, as well as any Firebase-wide automatic data collection settings.

If automatic data collection is disabled for Crashlytics, crash reports are stored on the device. To check for reports, use the checkForUnsentReports method. Use sendUnsentReports to upload existing reports even when automatic data collection is disabled. Use deleteUnsentReports to delete any reports stored on the device without sending them to Crashlytics.

Implementation

@override
Future<void> setCrashlyticsCollectionEnabled(bool enabled) async {
  try {
    Map<String, dynamic>? data = await channel
        .invokeMapMethod<String, dynamic>(
            'Crashlytics#setCrashlyticsCollectionEnabled', <String, dynamic>{
      'enabled': enabled,
    });

    _isCrashlyticsCollectionEnabled = data!['isCrashlyticsCollectionEnabled'];
  } on PlatformException catch (e, s) {
    convertPlatformException(e, s);
  }
}