getRemoteConfigValueForKey static method
- @Deprecated('This function is deprecated, please use "remoteConfigGetValue" instead')
Clear all remote config values. returns the error message or remote config value
Implementation
@Deprecated('This function is deprecated, please use "remoteConfigGetValue" instead')
static Future<String?> getRemoteConfigValueForKey(String key, Function(String?) callback) async {
if (!_instance._countlyState.isInitialized) {
String message = '"initWithConfig" must be called before "getRemoteConfigValueForKey"';
log('getRemoteConfigValueForKey, $message', logLevel: LogLevel.ERROR);
return message;
}
log('Calling "getRemoteConfigValueForKey" with the key:[$key]');
if (key.isEmpty) {
String error = 'getRemoteConfigValueForKey, key cannot be empty';
log(error);
return 'Error : $error';
}
List<String> args = [];
args.add(key);
final String? result = await _channel.invokeMethod('getRemoteConfigValueForKey', <String, dynamic>{'data': json.encode(args)});
callback(result);
return result;
}