setOptionalParametersForInitialization static method
- @Deprecated('This functions is deprecated, please use "setLocation" of CountlyConfig instead')
Set user location Should be called before init. returns the error or success message
Implementation
@Deprecated('This functions is deprecated, please use "setLocation" of CountlyConfig instead')
static Future<String?> setOptionalParametersForInitialization(Map<String, Object> options) async {
int optionsCount = options.length;
log('Calling "setOptionalParametersForInitialization" with options count:[$optionsCount]');
log('setOptionalParametersForInitialization is deprecated, use setLocation of CountlyConfig instead', logLevel: LogLevel.WARNING);
List<String> args = [];
options['city'] ??= 'null';
options['country'] ??= 'null';
options['latitude'] ??= 'null';
options['longitude'] ??= 'null';
options['ipAddress'] ??= 'null';
String? city = options['city'].toString();
String country = options['country'].toString();
String latitude = options['latitude'].toString();
String longitude = options['longitude'].toString();
String ipAddress = options['ipAddress'].toString();
args.add(city);
args.add(country);
args.add(latitude);
args.add(longitude);
args.add(ipAddress);
final String? result = await _channel.invokeMethod('setOptionalParametersForInitialization', <String, dynamic>{'data': json.encode(args)});
return result;
}