Ionic hybrid app geolocation blocked on iOS10

只谈情不闲聊 提交于 2019-12-23 17:31:40

问题


Since iOS 10 came out and I updated my iPhone 6 navigator.geolocation.getCurrentPosition() is not working.
Address and port: 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?

I've already tried what's mentioned here: Geolocation is blocked in iOS10

  • Editing in XCode was not helping
  • Editing the Info.plist in text editor was not helping

I have Cordova White List plugin istalled and I'm using this not recommended wildcard in my config.xml: <allow-navigation href="*"/> .

It works fine on android and was working fine on iPhone 6 before the iOS update.


回答1:


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.

If you don't use live reload the code will be loaded from inside your app using file:// protocol and geolocation will work.

Consider sending a bug report to ionic so they maybe can change the local server to serve the code through https



来源:https://stackoverflow.com/questions/39765463/ionic-hybrid-app-geolocation-blocked-on-ios10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!