Ionicview with firebase: failure to authenticate


#1

I have written an application that works fine when running on android (ionic run android) but doesn’t when running inside ionicview. I have jsconsole to capture the console and this is what I see. The code is pretty straight forward.

Any help appreciated. I would really like to use ionicview as a simple way to deploy this app on Android. This is a custom project and I don’t need or want wide distribution of google store.

Thanks

Pascal

– CODE –
function authenticate () {
var defer = $q.defer();
$ionicPlatform.ready (function () {
$log.debug (‘Authenticating with FB’);
Firebase.enableLogging(true);
var token = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxx”;
FB = new Firebase (‘https://xxxxx.firebaseio.com’);
$firebaseAuth (FB).$authWithCustomToken (token).then (function (data) {
self.authenticated = true;
$log.debug (‘Authentication succeeded’);
MsiNotify.success (‘Authentication succeeded’);
return defer.resolve (data);
}).catch (function (error) {
self.authenticated = false;
$log.debug (‘Authentication error’, error);
MsiNotify.error (error, ‘Authentication error’);
defer.reject (‘authentication error’);
});
});
return defer.promise;
};

– LOG –
remote console.loglink
"0: onDisconnectEvents "
remote console.loglink
"p:0: data client disconnected "
remote console.loglink
"p:0: Browser went offline. Killing connection. "
remote console.loglink
"c:0:1:0 Longpoll is being closed. "
remote console.loglink
"c:0:1: Closing realtime connection. "
remote console.loglink
"c:0:1: Shutting down all connections "
remote console.loglink
"c:0:1:0 Connecting via long-poll to https://s-dal5-nss-20.firebaseio.com/.lp?start=t&ser=xxxxxx&cb=2&v=5&ns=xxxxxx "
remote console.loglink
"p:0: Making a connection attempt "
remote console.loglink
"c:0:1: Connection created "
remote console.loglink
"p:0: Browser went online. "
remote console.loglink
"0: onDisconnectEvents "
remote console.loglink
"p:0: data client disconnected "
remote console.loglink
"c:0:0: Shutting down all connections "
remote console.loglink
"c:0:0:0 Longpoll is being closed. "
remote console.loglink
"c:0:0: Closing realtime connection. "
remote console.loglink
"p:0: Browser went offline. Killing connection. "
remote console.loglink
"c:0:0:0 Connecting via long-poll to https://s-dal5-nss-20.firebaseio.com/.lp?start=t&serxxxxxx=0&cb=1&v=5&ns=xxxxxxxx "
remote console.loglink
"c:0:0: Connection created "
remote console.loglink
"p:0: Making a connection attempt "
remote console.loglink
"p:0: Browser went online. "
remote console.loglink
"p:0: Browser went offline. Killing connection. "
remote console.loglink
"p:0: Admin auth credential detected. Reducing max reconnect time. "
remote console.loglink
"p:0: Authenticating using credential: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
remote console.loglink
"Trying to CONNECT"
remote console.loglink
"main controller"
remote console.loglink
"Authenticating with FB"
remote console.loglink
"p:0: Admin auth credential detected. Reducing max reconnect time. "
remote console.loglink
"p:0: Authenticating using credential: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
remote console.loglink
"p:0: Browser went online. “
remote console.loglink
"Trying to CONNECT"
remote console.loglink
"Authenticating with FB”


Ionic-View Android app not retrieving Firebase data
#2

+1, I have the same issue