Screenshot
Issue
facebookConnectPlugin.login
dialog shows error in screenshot. The only thing that can be done is selection of the X close-out button which results in the following error:
errorCode: "4201"
errorMessage: "User cancelled dialog"
loginError @ facebook.js:13
What are we doing wrong?
Plugin version, OS, devices, etc
8.1.1 ([email protected])
cordova-plugin-facebook4 3.0.0
Android 7.1.1
OSX 10.13.6
code
https://github.com/lightbeard/reproduce-fb-login
document.addEventListener('deviceready', deviceReady, false);
function deviceReady() {
var fbLoginSuccess = function (userData) {
console.log("UserInfo: ", userData);
}
facebookConnectPlugin.login(["public_profile"], fbLoginSuccess,
function loginError (error) {
console.error(error)
}
);
}
Awesome, nice to hear it worked out :)
To solves the error OP had to do the two following things:
Adding the missing configuration for
cordova-android
>= 7 inconfig.xml
Like described in the documentation https://github.com/jeduan/cordova-plugin-facebook4/blob/master/docs/android/README.mdAdding an Android platform to the corresponding Facebook App in his/her Facebook developper console https://developers.facebook.com/apps