作者:大美妞庄严典雅__ | 来源:互联网 | 2023-05-18 17:07
Ivebeenstrugglingwiththisforthepasttwodays.Ihavelookedatvariousresponsesbutnoneha
I've been struggling with this for the past two days. I have looked at various responses but none have solved my problem. I am using Phonegap Build to publish an iPhone app. One on of the features is to get the user's current location. Before the map loads I get two alerts, the first one is a normal alert asking me if I want to grant my current location. However the second alert show a directory path where the file is located also asking if I want to grant the app permission to my location (see image below) I tried the following suggested solution here Location permission alert on iPhone with PhoneGap without any luck.
过去两天我一直在努力解决这个问题。我看过各种各样的回答,但没有一个能解决我的问题。我正在使用Phonegap Build来发布iPhone应用程序。其中一个功能是获取用户的当前位置。在地图加载之前,我收到两个警报,第一个是正常警报,询问我是否要授予我当前位置。然而,第二个警报显示文件所在的目录路径,也询问我是否要将应用程序权限授予我的位置(请参见下图)我在此尝试了以下建议的解决方案:带有PhoneGap的iPhone上的位置权限警报没有任何运气。
This is what I have in my config.xml file
这就是我在config.xml文件中的内容
needs your location
I call the init function from the body tag
我从body标签调用init函数
function init(){
document.addEventListener("deviceready",onDeviceReady,false);
}
function onDeviceReady(){
navigator.geolocation.getCurrentPosition(success, fail);
}
I also tried these solutions but none work
我也试过这些解决方案,但都没有用
How to prevent double prompt for geolocation in Phonegap app?
如何防止在Phonegap应用程序中双重提示地理位置?
Location permission alert on iPhone with Cordova
使用Cordova在iPhone上的位置许可警报
What could I be doing wrong? Are there any examples or tutorials that anyone can recommend?
我能做错什么?是否有任何人可以推荐的示例或教程?
1 个解决方案