Facebook plugin_not_installed error


#1

I’m getting an plugin_not_installed error when trying to login with facebook with firebase.
I built it using Ionic Package and installed it on my iPhone.

I have already have firebase working with login in with the email and password, I’m just trying to add facebook login.

I am following this tutorial

So I ran this
ionic plugin add cordova-plugin-facebook4 --variable APP_ID=“123456789” --variable APP_NAME="myFacebookApName"
npm install --save @ionic-native/facebook

Added Facebook to the providers in my app.module.ts

My login code

facebookLogin() {

    this.facebook.login(['email']).then((response) => {
        const facebookCredential = firebase.auth.FacebookAuthProvider
            .credential(response.authResponse.accessToken);

        firebase.auth().signInWithCredential(facebookCredential)
            .then((success) => {
                console.log("Firebase success: " + JSON.stringify(success));
                this.userProfile = success;
            })
            .catch((error) => {
                alert("error 2");
                this.errorMessage = error
                console.log("Firebase failure: " + JSON.stringify(error));
            });

    }).catch((error) => {
        alert("error 1");
        this.errorMessage = error
        console.log(error)
    });
}

I am already using the plugins like Contacs and SocialSharing and the work fine on my device. Not sure what I am missing to get the plugin_not_installed error.

Thanks in advance.


#2

I forgot to add my system info

Cordova CLI: 6.5.0
Ionic Framework Version: 3.1.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.6
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.7.3
Xcode version: Not installed


#3

Try to add --save to the ionic plugin add ... call too. I think Ionic Package doesn’t know about the plugin yet and so doesn’t add/install it.


#4

That did it, thank you.