saveMax static method
- @Deprecated('This function is deprecated, please use "Countly.instance.userProfile.saveMax" instead and do not forget to call "Countly.instance.userProfile.save"')
Save max of current value and provided value returns the error or success message
Implementation
@Deprecated('This function is deprecated, please use "Countly.instance.userProfile.saveMax" instead and do not forget to call "Countly.instance.userProfile.save"')
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;
}