关闭ios弹出框:“would like to use your current location”

图一:

图二:

使用cordova生成ios项目,首次打开获取用户定位时会弹出两次对话框,关闭图二中对话框方法:

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
  navigator.geolocation.getCurrentPosition(onSuccess, onError);     
}

参考:Location permission alert on iPhone with PhoneGap

 

 

 

原文地址:https://www.cnblogs.com/suiyueshentou/p/7204415.html