Q:

Firebase Facebook Login with Ionic

I am making an Ionic 2 project with Firebase 3 JS SDK.
I have a problem when trying to log in with facebook using the firebase FacebookAuthProvider.
When I try to get the AuthCredential from the FacebookAuthProvider using
let provider = new firebase.auth.FacebookAuthProvider();
let credential = provider.credential(response.authResponse.accessToken);

At the provider.credential it says provider.credential is not a function.
Here is my full SerivceProvider function:
loginUserFacebook() {
Facebook.login(['email'])
.then(
  (response) => {
    let credential: firebase.auth.AuthCredential;
    credential = new firebase.auth.FacebookAuthProvider().credential(response.authResponse.accessToken);
    this.fireAuth.signInWithCredential(credential);
  }
)
.catch(
  (error) => {
    var errorMessage: string = error.message;
    let prompt = Alert.create({
      message: errorMessage,
      buttons: [{text: "Ok"}]
    });

    this.nav.present(prompt);
  }
);

}
I am importing import { Facebook } from 'ionic-native';
and have installed the cordova-plugin-facebook4
Thanks for the help!

A:

It's a javascript static method. Change to:
let credential = firebase.auth.FacebookAuthProvider.credential(response.authResponse.accessToken);

