Page 1 of 1

Issue with firebase chat

Posted: Sun Feb 07, 2021 7:21 pm
by chotchot

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 ( 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;
    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 :

Thank you so much for your support

Re: Issue with firebase chat

Posted: Wed Feb 10, 2021 10:55 am
by Serhii Kulibaba


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?