Cordova应用程序在iOS 10启动时挂起 [英] Cordova app hanging during startup on iOS 10

查看:137
本文介绍了Cordova应用程序在iOS 10启动时挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚安装了Xcode 8 beta,以便在iOS 10测试版中测试我现有的Cordova应用程序(通过模拟器)。当应用程序启动时,它只是挂在加载页面上 - 似乎 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).

任何遇到/修复此问题的人?

Anyone encountered/fixed this problem?

更新

此问题的其他症状包括:

Other symptoms of this problem include:


  • 如果你背景应用程序(切换回主屏幕)然后前景应用程序(切换回应用程序),应用程序将正确启动

  • 在执行上述切换之前,某些插件无法正常工作

推荐答案

好的,我发现问题和解决方案归功于这篇文章

OK, I found the problem and the solution thanks to this post:

似乎iOS 10需要 Content-Security-Policy 元标记中的其他条目,即缺口:文件:。添加这些后,我的 Content-Security-Policy 如下所示:

It seems that iOS 10 requires additional entries in the Content-Security-Policy meta tag, namely gap: and file:. After adding these, my Content-Security-Policy looks like this:

<meta http-equiv="Content-Security-Policy" content="default-src * gap: 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.

希望这有助于其他人。

这篇关于Cordova应用程序在iOS 10启动时挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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