Are local services enabled for a specific application?

Can I determine if location services have been disabled for a specific application? The problem is that [CLLocationManager locationServicesEnabled] returns YES, even if location services were disabled for a specific application ...

+3
source share
2 answers

If you are targeting iOS 4.2 and above, just use [CLLocationManager authorizationStatus]

It will return one of the following values CLAuthorizationStatus, which are mostly integers:

typedef enum {
   kCLAuthorizationStatusNotDetermined = 0,
   kCLAuthorizationStatusRestricted,
   kCLAuthorizationStatusDenied,
   kCLAuthorizationStatusAuthorized
} CLAuthorizationStatus;

For more information, find the documents for "CLLocationManager".

+10
source

, didFailWithError. ,

Apple Documentation States: , kCLErrorDenied. .

+5

Source: https://habr.com/ru/post/1770442/


All Articles