User Cancelled Dialog (4201) error when logging in Facebook


#1

hello,
i’m trying to make facebook login in ionic 2 app.
i get this error when i’m trying to log in with chrome://inspect or in my smartphone

Object {errorCode: “4201”, errorMessage: “User cancelled dialog”}

that’s my facebookLogin code

  facebookLogin(){
Facebook.login(['email']).then( (response) => {
  let 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) => {
        console.log("Firebase failure: " + JSON.stringify(error));
      });
  }).catch((error) => { console.log(error) });
   }

p.s
in android emulator the facebook login works fine.