Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does an iphone application receive didChangeAuthorizationStatus: delegate call?

I have a question about CLLocationManagerDelegate. The documentation says if the user changes the settings for your location services (in the iPhone's Settings.app) then your app is supposed to receive an didChangeAuthorizationStatus: message to the delegate. My question is, when would this happen?

If the user changed the setting, it means they are in the settings app, and your app is either backgrounded or not running at all, so in the former case, when would your app's CLLocationManager delegate get the didChangeAuthorizationStatus: call?

like image 433
Lana Miller Avatar asked Sep 01 '11 06:09

Lana Miller


1 Answers

I just ran across this method an hour ago, so good timing on the question!

It looks like in my case this method gets called:

  1. When the app becomes active.
  2. On allowing Location Services for the app on the initial startup of the app.

I wrote a quick test app you can find here:

https://github.com/mharper/LocationServices

It simply logs the authorization status whenever the method gets called.

like image 115
mharper Avatar answered Oct 20 '22 01:10

mharper