iosxcodefirebaseionic-frameworksecurity-policy

Ionic app in xcode8 suddenly "Refused to connect to firebase"


I hope somebody can help me here with a xcode 8 problem. I tried to run my Ionic 1.X app which was always working before but suddenly I get the error

"Refused to connect to wss://s-usc1c-nss-113.firebaseio.com/.ws?v=5&s=I8Oe2YgCmGwoOi8RXHRPe464UKdl&ns=myapp because it appears in neither the connect-src directive nor the default-src directive of the Content Security Policy."

I guess my problem is my security policy because some things have changed in ios 10 and for that reason I post here also my current security policy meta tag.

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

Thank you in advance...


Solution

  • I was be able to solve it with a couple of more parameter in my content-security-policy. Most important I added .firebase to script and connect. Complete looking now like this

    <meta http-equiv="Content-Security-Policy" content=" default-src * gap://ready file:; script-src 'self' 'unsafe-inline' 'unsafe-eval' cdn.firebase.com https://.firebaseio.com https://*.firebaseio.com; object-src 'self'; style-src 'self' 'unsafe-inline' ; connect-src * 'self' *.firebaseapp.com https://.firebaseio.com wss://*.firebaseio.com * ">