ios 移动 Safari 中的定位服务:“不允许”已保存...永远?即使重置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10422322/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 18:13:41  来源:igfitidea点击:

Location services in mobile Safari: Don't Allow is saved...forever? Even with reset

iosgeolocationmobile-safari

提问by Axel

My web app using location services worked fine until I started testing "Do not allow" use cases. Now an iPhone refuses to ever allow location services, even when I answer "OK" to "Safari" would like to use your current location.

在我开始测试“不允许”用例之前,我使用位置服务的 Web 应用程序运行良好。现在 iPhone 拒绝允许定位服务,即使我对“Safari”回答“确定”想使用您当前的位置。

To reproduce... Using iPhone on iOS 5.1:

要重现...在 iOS 5.1 上使用 iPhone:

  1. Load web page that makes location services calls (like http://smithsrus.com/geo.html)
  2. Answer "Do not allow" when user permission prompt appears.
  3. Reload page and answer "Do not allow" 2 more times.
  4. Reload page and see "User Denied" without getting a prompt.
  5. Go to "Settings->General->Reset->Reset Location Warnings" and tap "Reset Warnings".
  6. Return to Safari, reload page and now see the user permission prompt.
  7. Even if you answer "OK" the web page will still be Denied.
  1. 加载进行定位服务调用的网页(如http://smithsrus.com/geo.html
  2. 出现用户权限提示时回答“不允许”。
  3. 重新加载页面并再次回答“不允许”2 次。
  4. 重新加载页面并在没有提示的情况下查看“用户拒绝”。
  5. 转到“设置->常规->重置->重置位置警告”并点击“重置警告”。
  6. 返回 Safari,重新加载页面,现在可以看到用户权限提示。
  7. 即使您回答“OK”,网页仍将被拒绝。

I kill and restart Safari, I delete all website data, I turn Location Services on and off, I even reboot, and still Safari refuses to actually Allow location services even when I say I want to.

我杀死并重新启动 Safari,删除所有网站数据,打开和关闭定位服务,甚至重新启动,但 Safari 仍然拒绝实际允许定位服务,即使我说我想要。

Once you go through these steps, that web domain is dead to location services. I'm running out of domains to test

一旦您完成了这些步骤,该 Web 域就对位置服务无效了。我要测试的域用完了

I've searched many StackOverflow, Apple Developer and other sites for answers. But it sure looks like a bug to me. Answering a prompt with "Allow" but getting denied must be a bug. After answering "Allow" the location services icon appears at the top of the screen briefly but then disappears, and in Location Services settings Safari appears with "On" and the gray icon next to it.

我在许多 StackOverflow、Apple Developer 和其他网站上搜索了答案。但对我来说它确实看起来像一个错误。用“允许”回答提示但被拒绝一定是一个错误。回答“允许”后,定位服务图标会短暂出现在屏幕顶部,但随后消失,在定位服务设置中,Safari 显示为“开启”,旁边有灰色图标。

After trying a combination of reseting location warnings, turning on and off location services and closing and restarting the browser, I did manage to get one new error:
"The operation couldn't be completed. (kCLErrorDomain error 1.)" Sounds buggy.

在尝试了重置位置警告、打开和关闭位置服务以及关闭和重新启动浏览器的组合后,我确实遇到了一个新错误:
“操作无法完成。(kCLErrorDomain 错误 1。)”听起来有问题。

I'd rather it be something silly I am doing, can anyone tell me?

我宁愿这是我正在做的愚蠢的事情,有人可以告诉我吗?

回答by Mark

I got it after about giving up and thinking there wasn't a solution. I managed to share my location on my iPhone 4s by doing the following:

我在放弃并认为没有解决方案之后得到了它。通过执行以下操作,我设法在 iPhone 4s 上共享了我的位置:

Go to Settings -> General, scroll to the bottom and go to Reset-> Reset Location & Privacy.

转到Settings -> General,滚动到底部并转到Reset-> Reset Location & Privacy

The next time I opened my web-app to test its user location features, it worked like a charm. Hope this helps for all who have this problem.

下次我打开我的网络应用程序来测试它的用户位置功能时,它就像一个魅力。希望这对所有遇到此问题的人有所帮助。

回答by Tyson

The following steps solved it for me:

以下步骤为我解决了这个问题:

  1. Close all tabs in safari with the domain in question open.
  2. Close Safari (Hold home button and cross off).
  3. Settings -> General -> Reset -> Reset Location Warnings / Reset Location & Privacy.
  4. Open Safari and try again.
  1. 在有问题的域打开的情况下关闭 safari 中的所有选项卡。
  2. 关闭 Safari(按住主页按钮并划掉)。
  3. 设置 -> 常规 -> 重置 -> 重置位置警告/重​​置位置和隐私。
  4. 打开 Safari 并重试。

The trick (compared to mark's answer) is to make sure you close Safari fully. When I followed mark's answer, I got the prompt re-appearing for Safari itself, but not for my domain. After closing Safari then following mark's answer, I got 2 successive prompts, firstly for Safari, and then for my domain.

诀窍(与马克的回答相比)是确保您完全关闭 Safari。当我按照 mark 的回答进行操作时,我的提示重新出现在 Safari 本身,但不是我的域。关闭 Safari 后,按照马克的回答,我得到了 2 个连续的提示,首先是 Safari,然后是我的域。

回答by JFlo

I was having the same issue caused by repeatedly hitting the "Do not allow" option.

由于反复点击“不允许”选项,我遇到了同样的问题。

The way I fixed this in my iPad 2 was to go into "Settings > General > Restrictions", then enable restrictions (have to enter passcode). From there I went into "Location" under the "Allow Changes" section and checked "Allow Changes" and made sure location services were on for all the listed apps. This seems to have reset it for me. After that I could go back into "General > Restriction" and disable restrictions again.

我在 iPad 2 中修复此问题的方法是进入“设置 > 常规 > 限制”,然后启用限制(必须输入密码)。从那里我进入“允许更改”部分下的“位置”并选中“允许更改”并确保所有列出的应用程序都启用了位置服务。这似乎为我重置了它。之后,我可以返回“常规>限制”并再次禁用限制。

Hope this helps you!

希望这对你有帮助!