chotchot
Posts: 1
Joined: Sun Feb 07, 2021 7:07 pm

Issue with firebase chat

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Re: Issue with firebase chat

Hello,

Do you run this code in the Ionic 4 application?

Could you please provide us more details on how you use it, where you see this error, etc?

Return to “Issues”