Determining the location on iOS
- With the locationTracking option enabled
- Note.
For iOS, the option is enabled by default.
The location is determined with accuracy to the city. You can retrieve this information in reports and via the Logs API.
The app requests GPS access. Battery consumption may increase.
- With the locationTracking option disabled
- Note.
Starting with the Android AppMetrica SDK 5.0.0, the
locationTracking
option is disabled by default.If the version is lower than 5.0.0, the
locationTracking
option is enabled by default.The location is determined by the IP address with accuracy to the country. You can retrieve this information in reports, but not via the Logs API.
The app requests GPS access. Battery consumption does not increase.
Note. If you have enabled IP address masking, AppMetrica determines location with the accuracy to the country by the unmasked part of the IP address.
How to enable location determination
By default, the AppMetrica SDK is initialized with the enabled locationTracking option.
How to disable location determination
NO
value for the locationTracking property of the YMMYandexMetricaConfiguration configuration:// Creating an extended library configuration. YMMYandexMetricaConfiguration *configuration = [[YMMYandexMetricaConfiguration alloc] initWithApiKey:API_key]; // Disabling sending information about the device location. configuration.locationTracking = NO; // Initializing the AppMetrica SDK. [YMMYandexMetrica activateWithConfiguration:configuration];
Copied to clipboard
To disable locationTracking after initializing the library, use the method +setLocationTracking: of the YMMYandexMetrica class:
[YMMYandexMetrica setLocationTracking:NO];
Copied to clipboard
false
:// Creating an extended library configuration. let configuration = YMMYandexMetricaConfiguration.init(apiKey: "API key") // Disabling sending information about the location of the device. configuration?.locationTracking = false // Initializing the AppMetrica SDK. YMMYandexMetrica.activate(with: configuration!)
Copied to clipboard
To disable locationTracking after initializing the library, use the method setLocationTracking(_:) of the YMMYandexMetrica class:
YMMYandexMetrica.setLocationTracking(false)
Copied to clipboard