admin管理员组文章数量:1386666
I have a web app that has this code for getting the user's coordinates:
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
But the moment I updated to iOS9 it ceased to work. I'm not even getting the Safari prompt anymore asking permission to get my location. Anyone else having this issue after updating to iOS9 and was able to resolve it?
I have a web app that has this code for getting the user's coordinates:
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
But the moment I updated to iOS9 it ceased to work. I'm not even getting the Safari prompt anymore asking permission to get my location. Anyone else having this issue after updating to iOS9 and was able to resolve it?
Share Improve this question asked Sep 22, 2015 at 15:00 Mark LoganMark Logan 2035 silver badges20 bronze badges3 Answers
Reset to default 6I've noticed this myself and i'm wondering if iOS 9 Webkit has started to prevent this working via HTTP as I know Chrome will be preventing this shortly as it currently throws the following alert in the web console.
getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
Try enabling localization in the general settings of iOS. Settings > Localization > Press localization to enable it. And now it works.
It seems that iOS 9 has disabled localization in the settings, after installing.
If you are running on a mac, you'll need to enable location services for safari: enable location on OSX
本文标签:
版权声明:本文标题:javascript - navigator.geolocation.getCurrentPosition no longer working in Safari mobile after iOS9 update - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744493996a2608906.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论