I am building an application using a polymer starter kit and cordova to wrap a project. Now, since I use firebase as a database for storing data, I ended up using two built-in javascript firebase functions to search for user data:
getAuth ()
var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
var authData = ref.getAuth();
if (authData) {
console.log("Authenticated user with uid:", authData.uid);
}
onAuth ()
var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
ref.onAuth(function(authData) {
if (authData) {
console.log("Authenticated with uid:", authData.uid);
} else {
console.log("Client unauthenticated.")
}
});
These two functions require a reboot to return data from firebase, but:
window.location.reload();
does not work
Alos was looking for a Cordoba plugin: webview-reloader , installed it, but redirection and rebooting still do not work.
When I use the reload () function, the screen of my Android phone will be white and the application will stop working. You must close the application and open it again.
