問題描述
我有一個 Phonegap
應用程序.我在 HTML 中包含 cordova.js
(但不在 www
目錄中),我正在等待 deviceready
被觸發,然后我在打電話
I have a Phonegap
app. I am including cordova.js
in the HTML (but not in the www
directory), I am waiting for deviceready
to be fired, and then I'm calling
navigator.geolocation.getCurrentPosition(successCallback,failCallback);
我收到了兩個版本的對話框(按此順序):
I'm receiving both versions of the dialog (in this order):
本機對話框 - http://i.stack.imgur.com/H5y1O.png一個>
HTML 對話框 - http://i.stack.imgur.com/XbcmR.png
推薦答案
如果您使用的是 PhoneGap 3+ 版本,請確保您正確包含插件.
If you're using version 3+ of PhoneGap, make sure you're correctly including the plugin.
來自 PhoneGap v3.0.0 API 文檔:
從 3.0 版開始,Cordova 將設備級 API 實現為插件.使用命令行界面中描述的 CLI 插件命令為項目添加或刪除此功能
As of version 3.0, Cordova implements device-level APIs as plugins. Use the CLI's plugin command, described in The Command-line Interface, to add or remove this feature for a project
這篇關于iOS 使用當前位置權限對話框在 Phonegap 應用程序中顯示兩次的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!