Im having an issue where the login doesnt work as expected on ios. The facebook login always defaults to opening a webview instead of using the native facebook app.
I noticed in the source code that LoginManager.setLoginBehavior has return for ios so i guess this is intentionally disabled on ios?
Minimal code to reproduce the behavior
const onFacebookButtonPress = async () => {
console.log("Begin sign in: Facebook");
// Not supported on ios?
LoginManager.setLoginBehavior('NATIVE_WITH_FALLBACK');
// Attempt login with permissions
const result = await LoginManager.logInWithPermissions(['public_profile', 'email']);
if (result.isCancelled) {
console.log('User cancelled the login process');
return;
}
// Once signed in, get the users AccesToken
const data = await AccessToken.getCurrentAccessToken();
if (!data) {
throw 'Something went wrong obtaining access token';
}
// Create a Firebase credential with the AccessToken
const facebookCredential = auth.FacebookAuthProvider.credential(data.accessToken);
// Sign-in the user with the credential
return auth().signInWithCredential(facebookCredential).catch(function(error) {
if (error.code === "auth/account-exists-with-different-credential"){
alert("Facebook account does not exist.");
} else {
alert(error.message);
}
console.log(error.message+" with code: "+error.code);
});
}
I would be really grateful if anyone could provide some clarification if the native login i supported on ios and if there are any workaround to make the native app open instead of the webview.
Im having an issue where the login doesnt work as expected on ios. The facebook login always defaults to opening a webview instead of using the native facebook app.
I noticed in the source code that
LoginManager.setLoginBehavior
has return for ios so i guess this is intentionally disabled on ios?Minimal code to reproduce the behavior
I would be really grateful if anyone could provide some clarification if the native login i supported on ios and if there are any workaround to make the native app open instead of the webview.
Best regards!