Core Location keeps asking for permission
I could have sworn that the expected behavior for the core location permission dialog is something like this:
- if the user clicks "Yes", it will not be shown again
- if the user clicks "No", it is shown one more time, the next time the app launches. If the user clicks "No" a second time, it will not be shown again.
What I'm actually seeing is the following:
- the user has to click "Yes" twice in a row for that preference to be remembered
- no matter how many times the user clicks "No", tha开发者_高级运维t preference is not remembered
Did I just imagine the first expected behavior, or did it change at some point recently?
More to the point, what level of control do we have over this? Is it up to me to remember that the user said "No", and stop asking?
Is this documented anywhere?
My recollection is that the user always had to click "Yes" twice before it stopped asking.
The only documentation I can find at the moment is the LocateMe sample code, specifically the MyCLController class. In the locationManager:didFailWithError: method, they claim that
"Don't Allow" on two successive app launches is the same as saying "never allow". The user can reset this for all apps by going to Settings > General > Reset > Reset Location Warnings.
It seems that the behavior has changed such that it continues to ask permission even if you click "No", although I'm not sure when that happened. I don't believe that we need to remember this, but it wouldn't be too hard, since an error code of kCLErrorDenied
is returned if they click "No".
精彩评论