關閉ios彈出框:「would like to use your current location」

圖一:ios

圖二:iphone

使用cordova生成ios項目,首次打開獲取用戶定位時會彈出兩次對話框,關閉圖二中對話框方法:spa

document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { navigator.geolocation.getCurrentPosition(onSuccess, onError); }

參考:Location permission alert on iPhone with PhoneGapcode

相關文章
相關標籤/搜索