我有一个 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):
本机对话框 - i.stack.imgur/H5y1O.png HTML对话框 - i.stack.imgur/XbcmR。 png
Native Dialog - i.stack.imgur/H5y1O.png HTML Dialog - i.stack.imgur/XbcmR.png
推荐答案如果您使用的是3+以上的PhoneGap,请务必正确加入插件。
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的plugin命令(在命令行界面中描述)为项目添加或删除此功能
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应用程序中显示两次权限对话框
发布评论