Reputation: 1494
I have implemented Facebook authentication on my website. I have asked for user permissions to access their email address. I am testing the application right now and have granted permissions through my profile. I would like to know how can I access the email of the logged in Facebook user?
NOTE: I have already asked for the permission to access the email and have granted them from my profile for testing purpose.
Thanks, Anurag
Upvotes: 0
Views: 1234
Reputation: 32522
Just grab the object on graph: https://graph.facebook.com/{user id here}
All users have an "email" attribute.
Read the docs on users.
Upvotes: 1
Reputation: 100175
Try something like this:
$facebook->api('/me?fields=email');
//and result should be something like
Array
(
[email] => someemail
[id] => someid_of_user
)
Upvotes: 1