菜鸟教程小白 发表于 2022-12-11 17:28:49

ios - PhoneGap Geolocation 在 iOS10 中被阻止


                                            <p><p>我的 Phonegap 应用利用 (Cordova 3.8) webviews 'W3C Geolocation API'。然而,自从从 iOS 9.x 升级到 iOS 10(测试版)后,使用 </p>

<p><code>navigator.geolocation.getCurrentPosition(...)</code></p>

<p>现在返回错误:</p>

<p> <a href="http://i.stack.imgur.com/w5yVr.png" rel="noreferrer noopener nofollow">Access to geolocation was blocked over insecure connection to http://localhost. ERROR(2): Origin does not have permission to use Geolocation service</a> </p>

<p>我目前不使用 <a href="https://github.com/apache/cordova-plugin-whitelist" rel="noreferrer noopener nofollow">Cordova Whitelist Plugin</a> .会使用该帮助还是有更简单的解决方法?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我添加了 <a href="https://github.com/apache/cordova-plugin-geolocation" rel="noreferrer noopener nofollow">geolocation plugin</a>而不是使用默认的 Webview 地理定位 API</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - PhoneGap Geolocation 在 iOS10 中被阻止,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/39409071/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/39409071/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - PhoneGap Geolocation 在 iOS10 中被阻止