Cordova deviceready not firing in iOS until interacting with iOS

主宰稳场 提交于 2019-11-30 12:50:40

The problem was really subtle. I spent about 4h debugging iOS why was cordova not firing until I saw i was just missing two //, right here:

  <meta http-equiv="Content-Security-Policy" content="default-src 'self' data:* gap://* tel:* 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'" />

that small gapin Content-Security-Policy had to have two //in front for it to work. This solved my bug, I still don't understand why .-.

Hope this helps!

Shraavan Hebbar

I had same issue on iOS. Finally any of these two workarounds worked for

  1. Add <meta http-equiv="Content-Security-Policy".......> to index.

  2. Downgrade platform to 4.0.0 (Cordova platform update iOS@4.0.0)

Performing the first option is preferable as downgrading to 4.0.0 is probably not preferable to you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!