I'm playing around with the Facebook Javascript SDK to allow the end user to signup to my website via facebook, I've been following a tutorial online and so far so good, however I need to retrieve the user's email address, unfortunately response.email is always undefined, this is my code so far:
FB.login(function (response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me?fields=email,name', function (response) {
console.log(response);
console.log('Good to see you, ' + response.name + '.');
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
});
Which is executed off a button click, Now when I log response I have the userId and my name which is correct, after doing some googling some people have suggested I check that my email address on my facebook profile is set to public so I've gone through my profile set the relevant section to public but yet I still can't return the email address?
Any help would be appreciated.
Update
I've gone through and asked for permissions via the facebook SDK outlining the email address, this is now the response back from facebook after logging in again:
Yet when I drill down into email I see this:
Not the actual email address?

