saveMax static method

  1. @Deprecated('Use "Countly.instance.userProfile.saveMax" instead')
Future<String?> saveMax(
  1. String keyName,
  2. int saveMax
)

Implementation

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

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

  return result;
}