Reputation: 28882
How can I get the email address of a user from my app?
Right now I have it as
FB.Facebook.apiClient.users_getInfo(uid, 'last_name, first_name, email_hashes', userInfoCallback);
The last_name
and first_name
does work, but email_hashes
gives an empty Object.
Am I missing anything?
Thanks, Tee
Upvotes: 0
Views: 3041
Reputation: 703
For the record, the previous answer is no longer correct, you can query email (and proxied_email) these days if your app received email permission from the user:
FB.Facebook.apiClient.users_getInfo(uid,
'last_name, first_name, email',
userInfoCallback);
Upvotes: 3
Reputation: 56948
The short answer is: you can't. The point of FB Connect is authentication without having to enter an email. You're using Facebook as a proxy to authenticate. From their docs:
"Contact information (email address, phone number) are not directly available via the APIs."
You can use the javascript API to send emails to the user through Facebook however. You first have to using the ShowPermissionDialog method for the permission "email". This will give your application permission to contact the user. Then you can use the Notifications.sendEmail method.
Upvotes: 1