iOS10上阻止了离子混合应用地理位置 [英] Ionic hybrid app geolocation blocked on iOS10

查看:244
本文介绍了iOS10上阻止了离子混合应用地理位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从iOS 10升级后,我更新了我的iPhone 6 navigator.geolocation.getCurrentPosition()无法正常工作。

地址和端口:192.168 .0.16:8100


由于地理位置API被认为是不安全的来源,它只能使用SSL,但我可以在混合应用程序中,我不知道将是什么地址在每个电话?


我已经尝试过这里提到的内容:地理位置在iOS10中被阻止




  • 在XCode中编辑不起作用

  • 在文本编辑器中的Info.plist没有帮助



我有Cordova白名单插件,我使用这个不推荐的通配符my config.xml:< allow-navigation href =*/>


解决方案

问题是你是使用实时重新加载,当您使用实时重新加载时,应用代码是使用 http:// 协议从计算机上的本地Web服务器提供的。



如果你不使用实时重载,代码将从你的应用程序使用 file:// 协议和地理定位将工作。 p>

请考虑向ion发送错误报告,以便他们可以更改本地服务器以通过https提供代码


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.

解决方案

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

这篇关于iOS10上阻止了离子混合应用地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆