I am trying to use the Facebook API that provides first_name
, last_name
, gender
, email
, birthday
for signup on my website. I used the Graph API and generated an access token with necessary scope.
I tried on my personal account in which I created the app and it returned the fields properly, but for FB test user and friend's account, it returns email and birthday as "undefined". In graph.facebook.com it shows the following error for a friend's account.
Facebook returns email id for my friend's same account on doulingo.
Am I setting the permissions incorrectly or is there any other problem ?
The problem with my code was all because of not using access_token. I used access_token to retrieve all,
first_name
,last_name
,gender
,birthday
,email
.check my answer here to see that is a well known issue but not a bug for facebook developers.
Editing.. This is what they say in the facebook developers site:
Click on the "Get Access Token" button and select permissions you need. It will regenerate the access token and email and other values will became available.
Note:
See this and this threads for more details.