ios – 修复Cordova地理定位询问位置消息
有没有人有使用cordova,HTML的经验,并知道如何修复iOS的地理定位消息问题?我只想让消息说出应用名称后跟行,“想要使用你当前的位置.”
当前的地理定位消息:
我已经尝试过堆栈溢出和其他网站的各种解决方案.我实现了navigator.geolocation.getCurrentPosition(onSuccess,onError);代码,在每个html页面中包含我的cordova.js文件,确保< script> SRC = cordova.js< /脚本>首先出现在我的index.html页面中,包含我的config.xml文件中的geolocation标记,并尝试使用我的plist.有人请帮忙!!!! -谢谢 解决方法
除了
DaveAlden的答案,我不得不删除旧版本的地理定位插件并添加新版本.然后我不得不删除/添加Cordova iOS平台.只有这样才能成功将NSLocationWhenInUseUsageDescription添加到.plist文件中.
首先,删除/添加地理位置插件: cordova plugin rm org.apache.cordova.geolocation cordova plugin add org.apache.cordova.geolocation 其次,删除/添加iOS平台: cordova platform rm ios cordova platform add ios 最后,将NSLocationWhenInUseUsageDescription添加到.plist.打开/platforms/ios/{project}/{project}-Info.plist并添加以下内容: <key>NSLocationWhenInUseUsageDescription</key> <string>[App Name] would like to access your location when running and displayed.</string> 有关NSLocationWhenInUseUsageDescription与NSLocationAlwaysUsageDescription与NSLocationUsageDescription的详细信息,请参阅此iOS Developer Library link. Location permission alert on iPhone with Cordova可能是重复的. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |