I am creating an application using Ionic 2 that will make some calls to the Facebook API. I followed the steps from the documentation and installed the cordova cordova-plugin-facebook4 plugin .
Now I am trying to authenticate the user, but to no avail. My login page:
import {Page} from 'ionic-framework/ionic';
@Page({
templateUrl: 'build/pages/page1/page1.html',
})
export class Page1 {
login() {
facebookConnectPlugin.login(
['email'],
response => {
console.log(response);
},
error => {
console.log(error);
}
);
}
}
When I launch the application with:
ionic serve
I get the following error in the terminal:

When I click on the login button, I get the following error in the console:

And when I try to create an application to run on a real device, I get the following error in the console:

I think I need to import the plugin so that it can use, but how?
user1320990