I am trying to return the email address of a user using facebook api. A few days ago, it worked fine, but today it stopped working, and I don’t know why.
So first I get the access token:
FB.login(response => {
if (response.authResponse) {
resolve(response.authResponse.accessToken);
} else {
reject({
error: 'User cancelled login or did not fully authorize.'
});
}
}, {
scope: 'public_profile,email'
});
then I'm trying to get user data
FB.api('/me', {fields: 'first_name,last_name,email'}, function(response) {
console.log(response);
});
but I only get data for first_name and last_name. No email.
Also, when I ask for permission, he gives me the email as provided, but, as I said, the letter is not returned.
FB.api('/me/permissions', function(response) {
console.log(response);
});
Does anyone know what the problem is?
BTW: I am using API v2.4.