Milo
Milo

Reputation: 5091

Observe location services updates

How can I observe and call a method when the location services options change? For example, my app runs location services in the background, i.e. the option in Settings is set to always. What if the user changes the option while my app is still running, how can observe changes and make changes in my app accordingly?

Upvotes: 0

Views: 327

Answers (1)

Brandon
Brandon

Reputation: 2427

Implement the CLLocationManagerDelegate method

- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status

From the docs:

"This method is called whenever the application’s ability to use location services changes. Changes can occur because the user allowed or denied the use of location services for your application or for the system as a whole."

Upvotes: 1

Related Questions