Hi all,
I am using Firebase with Ionic for my app development.
I have set up a presence system, to show when the user is online or not.
My concern is, if the user leaves the app in background he gets disconnected from firebase after a while. (so far, so good)
I have a checkOnline() function on resuming the app, to check if the connection is still up with firebase, to make sure his actions are actually sent to the database. (nothing worse than a user believing his actions worked when they never got sent and firebase makes it look like it worked becauseo of offline capabilities)
This function looks like that:
$rootScope.checkOnline = function() {
isOnline.on('value', function(snapshot) {
console.log(snapshot.val());
if (snapshot.val()) {
return;
}
else {
Firebase.goOnline();
}
});
}
But this Firebase.goOnline() does not work!
If I have left the app in background for more than a few minutes, it seems like it doesn't reconnect anything..
Any help, please?