0
I am working in an app using Ionic 4. One of the requeriments is the user can log in using facebook. I follow this tutorial: https://www.djamware.com/post/5d949fa24ca99c5ee51238ef/ionic-4-tutorial-facebook-login-example, facebook and works almost perfectly the functionality.
I am using this app: https://github.com/jeduan/cordova-plugin-facebook4
Testing the app I found out the login fails when the native android facebook app is installed in the device.
I have replicated, the experiment in three diferents devices.
Here is the process when facebook app is not installed in the device:
The when I do click in the facebook login button, the facebook login box appears perfectly:
Now, when I tried to do the same when the facebook app is installed in the device happen the following:
I do click in the facebook login button
The login box of the facebook app appears, and I logged in the the facebook app.
But this error is show: “There is an error in logging you into this application. Please try again later”
I uninstalled the facebook app, and the login works again.
This is my login facebook function code:
fbLogin() {
this.platform.ready().then(() => {
if (this.platform.is('android')) {
this.fb.login(['public_profile', 'user_friends', 'email'])
.then(res => {
if (res.status === 'connected') {
this.isLoggedIn = true;
this.getUserDetail(res.authResponse.userID);
this.router.navigateByUrl("/tutorial");
} else {
this.isLoggedIn = false;
}
})
.catch(e => console.log('Error logging into Facebook', e));
}
});
}
I found this a similar app with another facebook login plugin for react: https://github.com/facebook/react-native-fbsdk/issues/633
Their “workaround” was to force the app to call regular facebook login box like this:
if (Platform.OS === "android") {
LoginManager.setLoginBehavior("web_only")
}
Is any similar “workaround” or way to force to use the web facebook login box without call the facebook app?
Thank you.