saveMin static method
- @Deprecated('This function is deprecated, please use "Countly.instance.userProfile.saveMin" instead and do not forget to call "Countly.instance.userProfile.save"')
Save min of current value and provided value returns the error or success message
Implementation
@Deprecated('This function is deprecated, please use "Countly.instance.userProfile.saveMin" instead and do not forget to call "Countly.instance.userProfile.save"')
static Future<String?> saveMin(String keyName, int saveMin) async {
if (!_instance._countlyState.isInitialized) {
String message = '"initWithConfig" must be called before "saveMin"';
log('saveMin, $message', logLevel: LogLevel.ERROR);
return message;
}
log('Calling "saveMin":[$keyName], Value:[$saveMin]');
if (keyName.isEmpty) {
String error = 'saveMin, key cannot be empty';
log(error);
return 'Error : $error';
}
List<String> args = [];
args.add(keyName);
args.add(saveMin.toString());
final String? result = await _channel.invokeMethod('userData_saveMin', <String, dynamic>{'data': json.encode(args)});
return result;
}