1

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...

Oliver
  • 647
  • 4
  • 20
  • I just tested and it is defiantly a iOS 10 thing. If I run my code in xcode simulator or real device before iOS10 all works fine. How ever once I switch to iOS10 or iOS10.1 I get the error above. – Oliver Nov 19 '16 at 10:50

1 Answers1

2

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 * ">

Oliver
  • 647
  • 4
  • 20