Two ways to get users primary email:
- For the authenticating user (ie the one who has granted your application access to their profile) and only when you explicitly request that permission.
- If the email is explicitly made public by some arbitrary user not authenticating with your app, then that will be available to you also. Any publically visable info you can see via facebook.com is equally accessible via the API.
For getting the authenticating users email, when you first request the oAuth dialog you need to pass a scope
with the email
permission (as well as whatever other permissions you require). See more about permissions here and more about using scope here .
When the email is available it can be found in the User
payload, see more about the API request and payload here.