saveMin static method

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

Implementation

@Deprecated('Use "Countly.instance.userProfile.saveMin" instead')
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;
}