本文介绍了iOS9更新后,navigator.geolocation.getCurrentPosition不再适用于Safari移动版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(function(position){

但是现在我更新到iOS9它已停止工作我甚至没有获得Safari提示请求获取我的位置的权限任何其他人在更新到iOS9之后发生此问题并且能够解决它?


$ b


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

这篇关于iOS9更新后,navigator.geolocation.getCurrentPosition不再适用于Safari移动版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 01:08