setCustomKey method

  1. @override
Future<void> setCustomKey(
  1. String key,
  2. String value
)
override

Sets a custom key and value that are associated with subsequent fatal and non-fatal reports.

Multiple calls to this method with the same key update the value for that key. The value of any key at the time of a fatal or non-fatal event is associated with that event. Keys and associated values are visible in the session view on the Firebase Crashlytics console.

Accepts a maximum of 64 key/value pairs. New keys beyond that limit are ignored. Keys or values that exceed 1024 characters are truncated.

Implementation

@override
Future<void> setCustomKey(String key, String value) async {
  try {
    await channel
        .invokeMethod<void>('Crashlytics#setCustomKey', <String, dynamic>{
      'key': key,
      'value': value,
    });
  } on PlatformException catch (e, s) {
    convertPlatformException(e, s);
  }
}