更新 iPhone 中的应用程序后 LocationManager 问题

发布于 2024-09-29 10:27:38 字数 316 浏览 0 评论 0原文

我正在使用 LocationManger 类来获取用户的当前位置。当我从应用程序商店安装应用程序并首次运行应用程序时,应用程序询问我“应用程序想要使用您当前的位置”。接下来是“不允许”和“确定”按钮。此时应用程序运行良好。

现在我卸载应用程序并从应用程序商店重新安装相同的应用程序。现在,当我尝试运行应用程序时,它不会提示我相同的位置对话框,并且位置管理器也无法检索位置并出现 kCLErrorDenied 错误。

我还尝试了应用商店中的其他两个应用程序,也发生了同样的问题。

有人对这种行为有想法吗?在这种情况下如何检索用户的当前位置?

谢谢, 吉姆.

I am using LocationManger class to get user's current location. When i install application from App store and run application first time application ask me that " APP would like to use your current location." followed by "Don't Allow" and "Ok" button. At this point of time application works fine.

Now I uninstall application and reinstall the same application from App store. Now when i tried to run application, it doesn't prompt me same location dialog and also Location Manager failed to retrieve the location with kCLErrorDenied error.

I also tried with two other application on App store, same problem happened.

Anyone has idea about this behaviour?? How to retrieve user's current location in this situation?

Thanks,
Jim.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鼻尖触碰 2024-10-06 10:27:38

如果用户拒绝您访问您的位置,他们必须进入设置菜单 ->一般->位置服务并从列表中选择您的应用程序。

在他们这样做之前,您的应用程序将无法访问 GPS。对不起!

If the user has denied you access to your location, they have to go into the settings menu -> General -> Location services and choose your app from the list there.

Until they do that, your app won't have access to the GPS. Sorry!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文