react-native-facebook-login
react-native-facebook-login copied to clipboard
Could not to get email
Same problem here
Same to me. There is no "email" info in the credentials object via the onLogin. There is no "public_profile" info also.
Found workaround/solution here
Hi @Jose4gg , @Dalamar I found the solution and if anyone has the same problem there, go to https://developers.facebook.com/apps/ Select the name of your app. Select App Review from the left panel. And complete the "Submit content for approval" section and wait for facebook approval. Use this link for some tests
FBLoginManager.loginWithPermissions(
['public_profile', 'email'],
(error, data) => {
if (!error) {
const { credentials } = data,
{ token } = credentials,
facebookGraphApi =
'https://graph.facebook.com/v3.2/me?fields=email&access_token=' +
token;
fetch(facebookGraphApi)
.then((response) => {
const { data } = response,
{ email } = data;
console.warn(email);
})
.catch(() => {});
} else {
console.warn('Error:', error);
}
}
);