The Apple documentation states that a CLAuthorizationStatus
of .restricted
means that:
The user cannot change this app’s status, possibly due to active restrictions such as parental controls being in place.
Can anybody tell me what other reasons (apart from parental controls) would cause this?
I would like to give the user a useful message about how they can go about removing the restriction, but not sure how I can phrase it.
You can find the long list of possible restrictions in within the "Settings" app.
Settings -> General -> Restrictions:
...
(way more scrolling down)
I found another case where .restricted will be returned for CLAuthorizationStatus. My app (on iPhone 5 running iOS 10.3) requested permissions as soon as it launched, and in some rare circumstances this request occurred before the app was actually in the foreground and .restricted was returned, even though Locations Services were on and the app had location permissions while in foreground.
In this case I never refreshed the permissions request so the app disabled it's location based features. So my advice is to make sure your app is in the foreground before asking, and if you can't do that, try refreshing CLAuthorizationStatus if it returns .restricted the first time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With