iOS 13 improves user privacy related to location sharing. If your app needs the location of the user to display recommend content, you may need to investigate if your app is still running properly.
Location Permission: Allow once
Starting with iOS 13, users get a new option to share their location just once. This means that the location of the user is shared until the app is closed.
When the user did choose to share it’s location just once, your app is requesting for location access each time. This can be very annoying if your app is only using the location for a functionality that is not the core of your app.
As a developer, you have to check which functionalities of your app are using the location of the device and only ask for permission when your user wants to use that functionality.
Always describe the reason why your app needs location access, to increase the change that your app gets that access. The description must be written in the info.plist by setting the property NSLocationWhenInUseUsageDescription.
Using the following code, you are able to get the current location access:
let locationManager = CLLocationManager() CLLocationManager.authorizationStatus()
When the user choose ‘Allow Once’, the CLAuthorizationStatus is set to authorizedWhenInUse. When the app will run again, the CLAuthorizationStatus is put back to notDetermined, which means you are able to ask for location permission again.
Insight in shared locations
Another improvement for users related to location sharing is insights in locations that are shared. The settings app is expanded with a map that shows all the locations that your app requested when you fetch the device location while in background mode.
If your app requests the location of the device in background mode, users may wonder why your app is requesting so many location and disable the permission.
Always respect user privacy and only ask permission if you need this for a properly working app. If you need background mode access to the device location, think about configuring region monitoring, to ensure you only receive the location of the device when the user is in the specific region your app is useful.
iOS 13 brings some great improvements for location privacy. As a developer, you need to be careful when asking for permission and always select a good moment including a good description of what you want to do with the location permission.
🚀 Like this article? Follow me on Twitter for more iOS related news!