<small id='mR8ta'></small><noframes id='mR8ta'>

    1. <i id='mR8ta'><tr id='mR8ta'><dt id='mR8ta'><q id='mR8ta'><span id='mR8ta'><b id='mR8ta'><form id='mR8ta'><ins id='mR8ta'></ins><ul id='mR8ta'></ul><sub id='mR8ta'></sub></form><legend id='mR8ta'></legend><bdo id='mR8ta'><pre id='mR8ta'><center id='mR8ta'></center></pre></bdo></b><th id='mR8ta'></th></span></q></dt></tr></i><div id='mR8ta'><tfoot id='mR8ta'></tfoot><dl id='mR8ta'><fieldset id='mR8ta'></fieldset></dl></div>

      • <bdo id='mR8ta'></bdo><ul id='mR8ta'></ul>
    2. <legend id='mR8ta'><style id='mR8ta'><dir id='mR8ta'><q id='mR8ta'></q></dir></style></legend>
    3. <tfoot id='mR8ta'></tfoot>

      修复 Cordova Geolocation 请求位置消息

      时间:2023-09-02
        • <tfoot id='c9DF6'></tfoot>
        • <small id='c9DF6'></small><noframes id='c9DF6'>

              <bdo id='c9DF6'></bdo><ul id='c9DF6'></ul>

                <tbody id='c9DF6'></tbody>
            • <i id='c9DF6'><tr id='c9DF6'><dt id='c9DF6'><q id='c9DF6'><span id='c9DF6'><b id='c9DF6'><form id='c9DF6'><ins id='c9DF6'></ins><ul id='c9DF6'></ul><sub id='c9DF6'></sub></form><legend id='c9DF6'></legend><bdo id='c9DF6'><pre id='c9DF6'><center id='c9DF6'></center></pre></bdo></b><th id='c9DF6'></th></span></q></dt></tr></i><div id='c9DF6'><tfoot id='c9DF6'></tfoot><dl id='c9DF6'><fieldset id='c9DF6'></fieldset></dl></div>

                <legend id='c9DF6'><style id='c9DF6'><dir id='c9DF6'><q id='c9DF6'></q></dir></style></legend>
                本文介绍了修复 Cordova Geolocation 请求位置消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                有没有人有使用cordova、html的经验并且知道如何为iOS解决这个地理定位消息问题?我只想让消息说出应用名称,后跟想使用您当前的位置".

                Does anyone have experience using cordova, html and know how to fix this geolocation message issue for iOS? I just want the message to say the app name followed by the line, "would like to use your current location."

                当前地理位置消息:

                ///Users/kklsndksjladn/Library/Developer/CoreSimulator/Devices/FAF7EE4C-40BA-430A-80D5-5C84B07D970D/data/Containers/Bundle/Application/DAE305B6-C6DD-438B-B4D7-9B183A8B2D97/HelpME.app/www/index.html

                ///Users/kklsndksjladn/Library/Developer/CoreSimulator/Devices/FAF7EE4C-40BA-430A-80D5-5C84B07D970D/data/Containers/Bundle/Application/DAE305B6-C6DD-438B-B4D7-9B183A8B2D97/HelpME.app/www/index.html

                我尝试了堆栈溢出和其他网站的各种解决方案.我实现了 navigator.geolocation.getCurrentPosition(onSuccess, onError); 代码,将我的 cordova.js 文件包含在每个 html 页面中,确保 <script>src=cordova.js</script> 首先出现在我的 index.html 页面中,在我的 config.xml 文件中包含地理定位标签并尝试使用我的 plist.有人请帮忙!!!!

                I've tried various solutions from stack overflow and other websites. I implemented the navigator.geolocation.getCurrentPosition(onSuccess, onError); code, included my cordova.js file in every html page, made sure <script> src=cordova.js</script> appears first in my index.html page, included the geolocation tag in my config.xml file and tried playing around with my plist. Someone please help!!!!

                -谢谢

                推荐答案

                除了 DaveAlden 的回答,我必须删除旧版本的地理定位插件并添加新版本.然后我不得不删除/添加 Cordova iOS 平台.只有这样我才能成功地将 NSLocationWhenInUseUsageDescription 添加到 .plist 文件中.

                In addition to the answer from DaveAlden, I had to remove the old version of the geolocation plugin and add the new one. Then I had to remove/add the Cordova iOS platform. Only then could I add NSLocationWhenInUseUsageDescription to the .plist file with success.

                首先,移除/添加地理定位插件:

                First, remove/add the geolocation plugin:

                cordova plugin rm org.apache.cordova.geolocation
                cordova plugin add org.apache.cordova.geolocation
                

                二、移除/添加iOS平台:

                Second, remove/add the iOS platform:

                cordova platform rm ios
                cordova platform add ios
                

                最后,将 NSLocationWhenInUseUsageDescription 添加到 .plist.打开 /platforms/ios/{project}/{project}-Info.plist 并添加以下内容:

                Last, add NSLocationWhenInUseUsageDescription to the .plist. Open /platforms/ios/{project}/{project}-Info.plist and add the following:

                <key>NSLocationWhenInUseUsageDescription</key>
                <string>[App Name] would like to access your location when running and displayed.</string>
                

                查看此iOS 开发者库链接 了解有关 NSLocationWhenInUseUsageDescriptionNSLocationAlwaysUsageDescriptionNSLocationUsageDescription 的详细信息.

                See this iOS Developer Library link for detailed information regarding NSLocationWhenInUseUsageDescription versus NSLocationAlwaysUsageDescription versus NSLocationUsageDescription.

                使用 Cordova 的 iPhone 上的位置权限警报可能是重复的.

                这篇关于修复 Cordova Geolocation 请求位置消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:Android Phonegap - 如何打开原生谷歌地图应用程序 下一篇:如何在自定义地图 iphone 和 android 上进行地理定位

                相关文章

                最新文章

                <small id='VTpm8'></small><noframes id='VTpm8'>

                • <bdo id='VTpm8'></bdo><ul id='VTpm8'></ul>
                1. <i id='VTpm8'><tr id='VTpm8'><dt id='VTpm8'><q id='VTpm8'><span id='VTpm8'><b id='VTpm8'><form id='VTpm8'><ins id='VTpm8'></ins><ul id='VTpm8'></ul><sub id='VTpm8'></sub></form><legend id='VTpm8'></legend><bdo id='VTpm8'><pre id='VTpm8'><center id='VTpm8'></center></pre></bdo></b><th id='VTpm8'></th></span></q></dt></tr></i><div id='VTpm8'><tfoot id='VTpm8'></tfoot><dl id='VTpm8'><fieldset id='VTpm8'></fieldset></dl></div>
                  <tfoot id='VTpm8'></tfoot>
                  <legend id='VTpm8'><style id='VTpm8'><dir id='VTpm8'><q id='VTpm8'></q></dir></style></legend>