# Location
# Enable location
Location is one of the risk parameters that can be sent to the server. In order to enable collection of location by the Encap SDK, you must:
- In your application configuration, check that
ENABLED_RISK_DATA
is set toALL
, or that it containsLocation
.
# Location data
The location data will be included in all requests to the server. The following values are collected:
latitude
longitude
accuracy
altitude
# Add usage description
Set a value forNSLocationWhenInUseUsageDescription
in the app's Info.plist
. This is the message that will be presented
to the end-user the first time the EncapAPI starts looking for a location.
When location is enabled, the location manager is not started until one of the start calls has been invoked. The location manager is disabled as soon as the finish call is done.
The location manager remains disabled until the next start call is invoked.
# Accuracy
You can use EncapConfig
setLocationAccuracy
to set the desired accuracy. The default value is kCLLocationAccuracyHundredMeters
.
To learn more, see Core Location Constants (opens new window) in the Apple developer documentation.