问题描述
我刚刚安装了Xcode 8测试版,以测试我现有的Cordova应用程序在iOS 10测试版(通过模拟器)。当应用程序启动时,它只是挂在加载页面上 - 似乎 deviceready
事件没有被触发。
I just installed Xcode 8 beta in order to test my existing Cordova app in iOS 10 beta (via Simulator). When the app is launched, it just hangs on the loading page - seems the deviceready
event is not being fired.
所以我也在我的iPad Air上安装了iOS 10测试版(只是为了防止它是一个模拟器问题),但我得到相同的结果。
So I also installed iOS 10 beta on my iPad Air (just in case it's a Simulator issue), but I get the same results.
此应用程式可在iOS 9.3(装置和模拟器)上正常运作。
The app works fine on iOS 9.3 (both device and Simulator).
任何人遇到/ ?
推荐答案
确定,我发现问题和解决方案感谢:
OK, I found the problem and the solution thanks to this post:
似乎iOS 10需要在 Content-Security-Policy
元标记,即 gap:// ready
和文件:
。添加这些之后,我的 Content-Security-Policy
如下所示:
It seems that iOS 10 requires additional entries in the Content-Security-Policy
meta tag, namely gap://ready
and file:
. After adding these, my Content-Security-Policy
looks like this:
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src * 'unsafe-inline' 'unsafe-eval'">
应用程序启动并在iOS 10上正常工作。
And the app starts up and works fine on iOS 10.
希望这有助于别人。
这篇关于挂起在iOS 10(测试版)启动时的Cordova应用程式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!