getRemoteConfigValueForKey static method
Implementation
@Deprecated('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;
}