我访问了所有关于这个问题的链接,没有人帮助我。
我得到错误代码3(超时),总是在执行方法"getCurrentLocation“从”科多瓦-插件-地理定位“在IOS上。
按照我的代码:
getCurrentPosition() {
return new Promise(function (resolve, reject) {
document.addEventListener("deviceready", function(){
navigator.geolocation.getCurrentPosition((position) => {
resolve(position);
}, (error) => {
reject(error);
}, {
timeout: 10000
});
}, false);
});
}我升级了所有插件和引擎,错误仍然存在。按照我现在的版本:
发布于 2017-12-22 18:01:31
经过艰苦的工作,我找到了解决办法。我在"/platform/ios/{project_name}/{project_name}-Info.plist":中添加了以下键
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>My app requires constant access to your location, even when the screen is off.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>My app requires constant access to your location, even when the screen is off.</string>https://stackoverflow.com/questions/47913715
复制相似问题