iOS使用当前位置在Phonegap应用程序中显示两次权限对话框 [英] iOS Use Current Location Permission dialog is shown twice in Phonegap app
问题描述
我有一个 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
Native Dialog - http://i.stack.imgur.com/H5y1O.png
HTML Dialog - http://i.stack.imgur.com/XbcmR.png
推荐答案
如果您使用的是3+以上的PhoneGap,请务必正确加入插件。
If you're using version 3+ of PhoneGap, make sure you're correctly including the plugin.
从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应用程序中显示两次权限对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!