Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In what cases is CLAuthorizationStatus "restricted"?

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.

like image 227
ganzogo Avatar asked Dec 09 '16 12:12

ganzogo


2 Answers

You can find the long list of possible restrictions in within the "Settings" app.

Settings -> General -> Restrictions:

...

(way more scrolling down)

like image 138
shallowThought Avatar answered Oct 06 '22 06:10

shallowThought


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.

like image 25
SafeFastExpressive Avatar answered Oct 06 '22 07:10

SafeFastExpressive