I am developing application in Ionic and when I run this application in iOS device it stucks on splashscreen for sometime and then it load.I check console and there it shows that device ready is fired after 95245 ms . That means device is taking too much time to being ready.
I search for the issue and find similar issue here and for that accepted solution is like below:
I added Thanks for your response @baviskarmitesh. But I had to add gap to the content security policy and now it seems to work.
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.
Now I am trying to pass this meta
tag for Content-Security-Policy
in my index.html
but whenever I build my iOS app using this command.
ionic cordova build ios
This Content-Security-Policy
meta tag is remove automatically from my index.html
. So how can I add this Content-Security-Policy
in my index.html
? Is there any other way ?
Make sure you are doing the changes on the index.html
file that is inside the src
folder.
When you run ionic cordova build ios
, it generates the www
folder with the src content and Cordova uses the www
folder content to build the app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With