When apps ask for permission to access user’s location, a new option “Precise” has been added
This option is also available under Settings for your app
Apps cannot opt out of this feature, it’s completely under user’s control
New enum type:
enum CLAccuracyAuthorization {
case fullAccuracy
case reducedAccuracy
}API changes to CLLocationManager
locationManagerDidChangeAuthorization(_: CLLocationManager)will get called when user change the authorization status or accuracy
Location delivery
CLLocationobjects will be sent todidUpdateLocations, with a center point and largehorizontalAccuracyvaluerecomputed about 4 times per hour
Demo of Apple Maps with “Precision: Off”
When asking for full accuracy:
Option 1: Navigate users to Settings app and grant full accuracy permanently. This may not be desirable for users.
Option 2: Ask for temporary permission to full accuracy. You need to provide a “purpose key”, which is defined in
Info.plist(You can have multiple entries to explain why you need full accuracy). Once granted, full accuracy will remain for the rest of the app session.
Region monitoring won’t work when precise mode is turned off
Send users to Settings when it makes sense
Accuracy authorization status are synced and shared between iPhone and Apple Watch
Best practices:
Adapt your app for all values of
accuracyAuthorizationBackground monitoring behavior will change under
reducedAccuracyConsider intentionally using
reducedAccuracyby default
As of iOS 13.4, users may choose to go from “while in use” to “always” without leaving the app. So it’s better for developers to ask for
.authorizedWhenInUsethe first time, and only ask for.authorizedAlwayswhen the user accesses a feature that needs itApp clips
No Always authorization
“While using” becomes “while using until tomorrow”
Widgets
Get location authorization from parent app, but still needs to specify a key in its
Info.plist
