iOS使用当前位置在Phonegap应用程序中显示两次权限对话框

编程入门 行业动态 更新时间:2024-10-21 03:18:35
本文介绍了iOS使用当前位置在Phonegap应用程序中显示两次权限对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 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应用程序中显示两次权限对话框

本文发布于:2023-11-27 19:00:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639218.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:当前位置   两次   对话框   应用程序   权限

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!