FirebaseExtended / angularfire

AngularJS bindings for Firebase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App does not load content from firebase on ios 10

aguillenv opened this issue · comments

Currently working on an ionic app. Content from firebase stop loading on ios 10. On android still working fine. Im using angularfire 1.2.0 and firebase 2.4.2. I've been looking for the new Content Security Policy and i added in my index.html the corresponding meta tag but still not working. The connection with another app on heroku works fine. Don't know what i'm missing.

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

We will need a lot more info to help you debug this. What kind of errors, if any are you getting? Do you have a reasonable repro we can make use of? Have you tried upgrading to the latest version of the Firebase and AngularFire libraries?

This is the error i'm getting repeatedly

[Error] Failed to load resource: An SSL error has occurred and a secure connection to the server cannot be made. (.lp, line 0)

Here is an example of one controller connecting with firebase

    var vm = this; 
    var ref = new Firebase(appConstants.firebaseUrl + 'data');
    var bannerObj = $firebaseObject(ref.child('banners'));

    vm.banners = [];
    vm.cont = 0;
    vm.goTo = goTo;

    bannerObj.$loaded()
      .then(function(banners_data){
        banners_data.forEach(function(banner){
          vm.banners.push(banner); 
        });

        vm.activeBanner = vm.banners[vm.cont];

        $interval(function(){
          if(vm.cont == vm.banners.length*2){ vm.cont = 0 };
          vm.cont++;
          vm.activeBanner = vm.banners[vm.cont % vm.banners.length];
        }, 35000);
      });

I would like to know if using the old firebase could be the reason of this problem. When i started to develop this app angularfire was not ready for firebase's new sdk, so it was working ok and i haven't upgraded yet.

Can you try adding "wss://*.firebaseio.com" to the connect-src section?

Are you still having an issue @aguillenv?

Closing due to inactivity. Please let us know if you are still having issues.

Thanks for your help, I had to add the "wss://.firebaseio.com" and also "https://.firebase.com/" for auth. In adition to this problem i was having troubles with the device where i was trying to install the app because it was caching somehow the app and it wasn't updating the index.html with the new CSP rules. Problem solved, thanks.