deviceready仅在iOS 10中30秒后启动

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

ionic run ios --device -lcs 

我用ionic plugin rm ...删除了所有ionic plugin rm ... ,删除了plugins/目录的内容并重新安装它们。 我还使用ionic platform rm/add ios删除并重新安装了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.js,AppCtrl.js和我主视图的控制器都封装在$ ionicPlatform.ready(function(){..});;

我的内容安全政策是:

  

我添加了感谢您的回复@baviskarmitesh。 但我不得不在内容安全策略上增加gap ,现在它似乎有效。

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

  

现在,设备已经快速启动了我的所有插件。

这似乎是Ionic框架的常见问题,可能有多种原因。 一个原因可能是您使用的插件存在一些问题,或者也可能是由于平台文件夹中的某些问题。 在Ionic CLI项目中似乎存在一个未解决的问题 。

以下可能是此问题的可能修复:

  1. 删除有故障的插件并重新添加
  2. 删除平台文件夹并重新添加。
  3. 可能避免使用实时重新加载选项
  4. 如果问题是iOS特定的,那么您可以尝试放宽内容安全策略

您还可以查看此链接

希望这应该有所帮助。