CLLocationManager 不提示用户并返回 NULL

发布于 2024-10-02 09:16:54 字数 398 浏览 0 评论 0原文

直到昨天为止,我的 iPhone 上一切都运行良好。从今天开始,我注意到 CLLocationManager 不会提示用户“此应用程序想要使用您的位置”,并继续在 didUpdateToLocation 中返回 null。我尝试使用开发配置、临时和产品配置文件签署我的应用程序。另外,我确保在尝试此操作之前删除该应用程序。早些时候,当我第一次运行该应用程序时,它会提示我推送通知和 GPS 提示。但现在,这些提示都没有出现。

我的应用程序在 AppDelegate 中执行 CLLocationmanagerstartupdatingLocation --> applicationdidLaunch 和 applicationdidLaunchwithOptions。另外,CLLocationManager 不会调用我的 didFailWithError。

Till yetsterday everything was working fine on my iPhone. Starting today, I noticed that CLLocationManager does not prompt the user "this app wants to use your location" and proceeds to return me null in the didUpdateToLocation. I have tried signing my app with dev provisioning, adhoc and prod profiles. Also, I am making sure that I delete the app before trying this. Earlier the moment I would run the app first time, it would prompt me for push notifications and GPS prompt. But now, none of these prompts are showing up.

My App does a CLLocationmanager startupdatingLocation in AppDelegate --> applicationdidLaunch and applicationdidLaunchwithOptions. Also, CLLocationManager does not call my didFailWithError.

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

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

发布评论

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

评论(1

迷荒 2024-10-09 09:16:54

回复我自己。我使用 testflighapp.com 进行 Beta 测试,我不确定这是否是造成这种情况的原因,但我所要做的就是转到 iPhone--> 设置--> 常规--> 重置--> 重置位置警告。

当我这样做并运行我的应用程序时,它确实提示我输入 GPS,之后一切都开始正常工作。

Replying to myself. I was using testflighapp.com for beta testing and I am not sure if that was causing it, but all I had to do was go ti iPhone-->Settings-->General-->Reset-->Reset Location Warnings.

Once I did that and ran my app, it did prompt me for GPS and everything started working fine after that.

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