deviceready仅在iOS 10中30秒后启动 [英] deviceready only fire after 30 seconds in iOS 10
问题描述
当我在我的iOS设备上运行它时,我的设备已经不会在我的离子应用程序中触发或触发
I deviceready doesn't fire or fires very late in my ionic app when I run it on my iOS device with
ionic run ios --device -lcs
我删除了所有带离子的插件插件rm ...
,删除插件/
目录的内容并重新安装它们。
我还用离子平台rm / add ios
删除并重新安装了ios平台。
I removed all the plugins with ionic plugin rm ...
, deleted the content of the plugins/
directory and reinstalled them.
I also removed and reinstalled the ios platform with ionic platform rm/add ios
.
我是坚持这个。
iPhone(6+)在iOS 10上。
The iPhone (6+) is on iOS 10.
我正在使用离子1 ,以及最后一个离子CLI。
I am using ionic 1, and the last ionic CLI.
编辑:我逐个删除了所有插件,似乎问题是由于cordova- plugin-network-information和cordova-plugin-device。
I removed all plugins one by one, and its seems that the problem is due to cordova-plugin-network-information and 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(){..}); `
My run.js, AppCtrl.js and the controller of my main view are encapsultaed in $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: *;">
推荐答案
我添加了感谢您的回复@baviskarmitesh。但是我必须将 gap
添加到内容安全策略中,现在它似乎正常工作。
I added Thanks for your response @baviskarmitesh. But I had to add gap
to the content security policy and now it seems to work.
我添加了 data:gap:https://ssl.gstatic.com'nickafe-eval'
在 default-src *
之后进入我的<我的index.html文件中的strong>内容安全策略,如下所示:
I added data: gap: https://ssl.gstatic.com 'unsafe-eval'
after default-src *
into my content security policy in my index.html file, like this:
<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: *;
">
现在我的所有插件都会快速启动设备。
And now deviceready fires quickly with all my plugins.
这篇关于deviceready仅在iOS 10中30秒后启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!