deviceready仅在iOS 10中30秒后启动

Lou*_*uis 7 device ios cordova ionic-framework

当我在我的iOS设备上运行它时,我的设备已经在我的离子应用程序中不会触发或触发

ionic run ios --device -lcs
Run Code Online (Sandbox Code Playgroud)

我删除了所有插件ionic plugin rm ...,删除了plugins/目录的内容并重新安装它们.我还删除并重新安装了ios平台ionic platform rm/add ios.

我坚持这个.

iPhone(6+)在iOS 10上.

我正在使用离子1和最后一个离子CLI.

编辑:我逐个删除了所有插件,似乎问题是由于cordova-plugin-network-information和cordova-plugin-device.

Process 663 detached
(lldb) 
(node:26790) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.

14    030280   warn     Native: deviceready did not fire within 2000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.
15    030605   info     [object Object]
16    033286   log      deviceready has not fired after 5 seconds.
17    033290   log      Channel not fired: onCordovaInfoReady
18    033293   log      Channel not fired: onCordovaConnectionReady
19    363977   log      DEVICE READY FIRED AFTER, 32259, ms
Run Code Online (Sandbox Code Playgroud)

我的run.js,AppCtrl.js和我的主视图的控制器都包含在$ ionicPlatform.ready(function(){..})中;

我的内容安全政策是:

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; connect-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ws: *;">
Run Code Online (Sandbox Code Playgroud)

Lou*_*uis 11

我添加了感谢您的回复@baviskarmitesh.但我不得不添加gap到内容安全策略,现在它似乎工作.

我加入data: gap: https://ssl.gstatic.com 'unsafe-eval'default-src *到我的内容安全策略在我的index.html文件,如下所示:

<meta http-equiv="Content-Security-Policy" content="
  default-src * data: gap: https://ssl.gstatic.com 'unsafe-eval';
  style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
  script-src 'self' 'unsafe-inline' 'unsafe-eval' *;
  connect-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ws: *;
">
Run Code Online (Sandbox Code Playgroud)

现在,设备已经通过我的所有插件快速启动.