核心位置不断征求许可 [英] Core Location keeps asking for permission

查看:69
本文介绍了核心位置不断征求许可的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能发誓核心位置权限对话框的预期行为是这样的:




  • 如果用户单击是,则不会再次显示

  • 如果用户单击否,则会在下次启动该应用时再次显示该信息。如果用户第二次单击否,它将不再显示。



我实际上看到的是以下内容:




  • 用户必须连续两次单击是才能记住该偏好设置

  • 无论用户单击否多少次,都不会记住该首选项



我只是想象第一个预期行为,或者它最近在某个时候改变了?



更重要的是,我们对此有什么控制水平?我是否应该记得用户说不并停止询问?



此文档是否记录在任何地方?

解决方案

我的回忆是,用户总是必须两次单击是才能停止询问。



目前可以找到的文档是LocateMe示例代码,特别是MyCLController类。在locationManager:didFailWithError:方法中,他们声称


在两次连续的应用程序启动中不允许与说绝对不允许。用户可以通过转到设置>常规>重置>重置位置警告来为所有应用重置此设置。


进行了更改,即使您单击否,它仍会继续征求许可,尽管我不确定何时发生。我不认为我们需要记住这一点,但这并不难,因为如果单击否,则会返回错误代码 kCLErrorDenied 。 / p>

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?

解决方案

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

这篇关于核心位置不断征求许可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆