setCustomCrashSegment static method

  1. @Deprecated('This function is deprecated, please use "setCustomCrashSegment" of CountlyConfig instead')
Future<String?> setCustomCrashSegment(
  1. Map<String, Object> segments
)

Set optional key/value segment added for crash reports. Should be call before Countly init returns error or success message

Implementation

@Deprecated('This function is deprecated, please use "setCustomCrashSegment" of CountlyConfig instead')
static Future<String?> setCustomCrashSegment(Map<String, Object> segments) async {
  int segCount = segments.length;
  log('Calling "setCustomCrashSegment" segmentation count:[$segCount]');
  log('setCustomCrashSegment is deprecated, use setCustomCrashSegment of CountlyConfig instead', logLevel: LogLevel.WARNING);
  List<String> args = [];
  segments.forEach((k, v) {
    args.add(k.toString());
    args.add(v.toString());
  });

  final String? result = await _channel.invokeMethod('setCustomCrashSegment', <String, dynamic>{'data': json.encode(args)});

  return result;
}