Hi everyone,
I'm trying to build a chat app with firebase but I'm having issues with importing/using firebase, despite I did import the .js file as a Javascript file as pictured in this video (https://www.youtube.com/watch?v=ZL276T_vzGs). This example works well...
The code below is launched when login button is pushed :
Code: Select all
var provider = new this.window.firebase.auth.GoogleAuthProvider();
this.window.firebase.auth().signInWithPopup(provider).then(function(result) {
this.Apperyio.get("$rootScope").displayName = result.diplayName;
this.Apperyio.navigateTo("Chat");
this.$scope.$apply();
}).catch(function(error){
alert("Error: " + JSON.stringify(error))
})
I get the error : "TypeError: this.window.firebase.auth is undefined"
The variable "window" is well defined btw.
Unfortuntately the video made by Appery to build a chat app with firebase, is too old so does not work anymore : https://www.youtube.com/watch?v=U7enpQvvC1w
Thank you so much for your support