views:

43

answers:

1

Cross-posted from http://forum.developers.facebook.com/viewtopic.php?pid=254519.

I have users of my application who have granted the application the email extended permission, but I neglected to query for their email address at the time that they granted the permission, and so don't have it. I do have their facebook ID.

My understanding is that I can wait until they log in, and then use their session to query for their email address, which I can then store indefinitely. Is there a way that I, as a developer, can get their email address without them having to log in? That is, can I make a query using my session and get another user's email, if my session is that of a developer of an application to which they have granted email permissions?

If so, some sample code would be lovely. Thanks!

A: 

No need to wait for their login, you can still get it like this assuming they have provided you with email permission:

$email_info = $facebook->api_client->users_getInfo($user_id, "email");
print_r($email_info);
Sarfraz

related questions