3 ms·
>And then they invoked the system permissions dialog that allows the user to grant location access, but instead of only asking for permission to access user dat
by alickz 4y ago
>And then they invoked the system permissions dialog that allows the user to grant location access, but instead of only asking for permission to access user data when the app is open, they told iOS to ask the user if they could always have access to location data.
It's been a while since I used CoreLocation but I do not think this is possible.
To request Always location permissions iOS apps _must_ first request When In Use location permission.
Only then, after the user grants Allow While Open (not Allow Once), and iOS starts delivering location updates to the app, will the iOS system give a _second_ prompt to the user requesting Always permission.
There's no way to jump straight to the Always permission AFAIK.
https://developer.apple.com/documentation/corelocation/cllocationmanager/1620551-requestalwaysauthorization https://developer.apple.com/documentation/corelocation/clloc...
> If your app’s current state is CLAuthorizationStatus.notDetermined (the default) and you call requestAlwaysAuthorization(), Core Location uses two prompts before it fully enables Always authorization.
> The first prompt displays immediately with the string from NSLocationWhenInUseUsageDescription.
> The second prompt displays when Core Location prepares to deliver an event to your app requiring CLAuthorizationStatus.authorizedAlways. If the app is in the Provisional Always state, the system displays the second prompt with the string from NSLocationAlwaysUsageDescription. Core Location will typically display the second prompt when your app isn’t running.
- 9935c101ab17a66 4y agoAh! Nice. It definitely looks like you're correct. Thanks for the information and for following up.