Core Location keeps asking for permission

╄→гoц情女王★ 提交于 2019-12-07 08:27:16

问题


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", that 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?


回答1:


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".



来源:https://stackoverflow.com/questions/1631733/core-location-keeps-asking-for-permission

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!