[英]Ionic hybrid app geolocation blocked on iOS10
Since iOS 10 came out and I updated my iPhone 6 navigator.geolocation.getCurrentPosition()
is not working. 自iOS 10问世以来,我更新了我的iPhone 6
navigator.geolocation.getCurrentPosition()
无效。
Address and port: 192.168.0.16:8100 地址和端口:192.168.0.16:8100
Since geolocation API is considered as unsecured origin it would work only with SSL but can I do it in a Hybrid application where I don't know what will be the address on each phone? 由于地理位置API被认为是不安全的来源,它只适用于SSL,但我可以在混合应用程序中进行,我不知道每部手机上的地址是什么?
I've already tried what's mentioned here: Geolocation is blocked in iOS10 我已经尝试过这里提到的内容: 在iOS10中阻止了地理定位
I have Cordova White List plugin istalled and I'm using this not recommended wildcard in my config.xml: <allow-navigation href="*"/>
. 我有Cordova White List插件,我在我的config.xml中使用了这个不推荐的通配符:
<allow-navigation href="*"/>
。
It works fine on android and was working fine on iPhone 6 before the iOS update. 它在Android上工作正常,并且在iOS更新之前在iPhone 6上运行良好。
The problem is you are using live reload, when you use live reload the app code is served from a local web server on your computer using http://
protocol. 问题是您正在使用实时重新加载,当您使用实时重新加载时,应用程序代码是使用
http://
协议从计算机上的本地Web服务器提供的。
If you don't use live reload the code will be loaded from inside your app using file://
protocol and geolocation will work. 如果您不使用实时重新加载,则将使用
file://
协议从应用程序内部加载代码,并且geolocation将起作用。
Consider sending a bug report to ionic so they maybe can change the local server to serve the code through https 考虑向离子发送错误报告,以便他们可以通过https更改本地服务器以提供代码
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.