views:

1299

answers:

2

Hi,

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

+1  A: 

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.

Typeoneerror
+1  A: 

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);
Korbinian