increment static method

  1. @Deprecated('Use "Countly.instance.userProfile.increment" instead')
Future<String?> increment(
  1. String keyName
)

Implementation

@Deprecated('Use "Countly.instance.userProfile.increment" instead')
static Future<String?> increment(String keyName) async {
  if (!_instance._countlyState.isInitialized) {
    String message = '"initWithConfig" must be called before "increment"';
    log('increment, $message', logLevel: LogLevel.ERROR);
    return message;
  }
  log('Calling "increment":[$keyName]');
  if (keyName.isEmpty) {
    String error = 'increment, key cannot be empty';
    log(error);
    return 'Error : $error';
  }
  List<String> args = [];
  args.add(keyName);

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

  return result;
}