地理位置与PhoneGap的建设工作将后的config.xml [英] Geolocation not working with Phonegap Build after adding config.xml

查看:248
本文介绍了地理位置与PhoneGap的建设工作将后的config.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有codeD使用HTML和JavaScript小应用程序地理位置。我使用PhoneGap的建立它。

I have coded a small geolocation application using HTML and Javascript. I am using Phonegap to build it.

地理位置精细的工作,直到加入config.xml文件。我添加了所有正确的权限的PhoneGap(3.1.0)。

Geolocation worked fine until adding the config.xml file. I have added all the correct permissions for Phonegap (3.1.0).

下面是code中的相关内容:

Here's the relevant bits of code:

<!--
Enable individual API permissions here.
The "device" permission is required for the 'deviceready' event.
-->
<feature name="http://api.phonegap.com/1.0/device" />
<feature name="http://api.phonegap.com/1.0/geolocation"/>

<preference name="permissions" value="INTERNET" />

下面是完整的code,如果有兴趣: https://github.com/wolffe/LifeMap,这里的应用程序: https://build.phonegap.com/apps/725755/builds

Here's the full code, if interested: https://github.com/wolffe/LifeMap, and here's the app: https://build.phonegap.com/apps/725755/builds

编辑#1:它可以在浏览器

编辑#2:我已删除了科尔多瓦插件允许

EDIT #2: I have removed the Cordova plugin permission.

编辑#3:我已删除config.xml文件,它现在的作品一次。使用PhoneGap的生成3.1.0。

EDIT #3: I have removed the config.xml file and it now works again. Using Phonegap Build 3.1.0.

推荐答案

我不认为科尔多瓦地理位置插件的作品非常好 - 开发商同意解除precate的地理定位插件<一个href=\"http://mail-archives.apache.org/mod_mbox/cordova-dev/201401.mbox/%3CCAOBL_k4A6+0i_sHD+qpY7PXbEMATe+onR6EyhBT0G-w_N812rw@mail.gmail.com%3E\"相对=nofollow> pretty最近因为浏览器提供的Web地理位置工作以及更好地或在某些情况下。

I don't think that the Cordova geolocation plugin works very well - the developers agreed to deprecate the geolocation plugin pretty recently because the Web Geolocation provided by the browser works as well or better in some cases.

我觉得你应该从你的项目中删除地理位置插件。你应该能够保持所有的JavaScript一样,因为我是pretty确保它是相同的API。我不知道有关的权限或没有,但因为它是网络GPS我觉得你不必有特殊权限。

I think you should remove the geolocation plugin from your project. You should be able to keep all of your JavaScript the same since I'm pretty sure it's the same API. I'm not sure about the permissions or not, but since it's Web GPS I'd think you don't have to include special permissions.

这篇关于地理位置与PhoneGap的建设工作将后的config.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆