Firebase not work in ios simulator but work in chrome


#1

Hi,
I try to add firebase auth service.
Following is the factory, it did console log “auth factory started” in chrome.
But it failed at ios simulator, could some one give me some hint? thanks.

angular.module('mychat.services', ['firebase'])
.factory("Auth",
    function ($firebaseAuth, $rootScope) {
        console.log('auth factory started');
        var ref = new Firebase(firebaseUrl);

        return $firebaseAuth(ref);
    })

#2

Looks like the promise did not resolve , so the loginController is note initialized.

.state('login', {
            url: "/login",
            templateUrl: "templates/login.html",
            controller: 'LoginCtrl',
            resolve: {
                "currentAuth":
                    function (Auth) {
                        alert("Got auth result!");
                        // $waitForAuth returns a promise so the resolve waits for it to complete
                        return Auth.$waitForAuth();
                    }
            }
        })

Any idea? Thanks


#3

hello, did you get it working? i have the same problem and have no clue, please share if u know more about it now, thanks


#4

See here: http://stackoverflow.com/questions/30409361/ionic-firebase-auth-worked-on-web-but-not-ios-simulator/37558198#37558198