I get a problem to login with facebook in react native (Android), I use this package https://github.com/facebook/react-native-fbsdk, in a mobile development is success, but in another mobile fail all.
This is my script:
async loginFacebook() {
try {
LoginManager.setLoginBehavior('WEB_ONLY');
const result = await LoginManager.logInWithPermissions([
"public_profile",
"email",
]);
if (result.isCancelled) {
console.log('Login cancelled');
}else{
console.log(
`Login success with permissions: ${result.grantedPermissions.toString()}`
);
const data = await AccessToken.getCurrentAccessToken();
if (!data) {
console.log('Something went wrong obtaining the users access token');
}
const credential = firebase.auth.FacebookAuthProvider.credential(
data.accessToken
);
const firebaseUserCredential = await firebase
.auth()
.signInWithCredential(credential);
alert(JSON.stringify(firebaseUserCredential.user.toJSON().email));
console.log(firebaseUserCredential.user.toJSON().email);
}
} catch (e) {
console.log(e);
}
}
The fail message in the app like this :
login failed: you can't use facebook to log into this app or website because there's an issue with implementation of facebook login
The message in the Inbox of Developer Facebook like this :
I tried to look for many examples, but fail all, they said that I must change the valid hash key and I done it (add valid hash key, release hash key and debug hash key). I don't know again how to solve this problem.
Please anyone help me to solve this problem.
Thanks.