setCustomData static method

Future<void> setCustomData({
  1. required String key,
  2. required String value,
})

setCustomData

Attach one key value pair to existing custom data.

Params

key The value you want to add

value The key of the attribute

Available Platforms

Android, iOS, Web

Implementation

static Future<void> setCustomData({
  required String key,
  required String value,
}) async {
  if (!kIsWeb && !io.Platform.isAndroid && !io.Platform.isIOS) {
    debugPrint('setCustomData is not available for current operating system');
    return;
  }

  await _channel.invokeMethod(
    'setCustomData',
    {
      'key': key,
      'value': value,
    },
  );
}