图一:
图二:
使用cordova生成ios项目,首次打开获取用户定位时会弹出两次对话框,关闭图二中对话框方法:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
navigator.geolocation.getCurrentPosition(onSuccess, onError);
}
参考:Location permission alert on iPhone with PhoneGap