Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Graph API returning numbers instead of email addresses

I'm using Facebook Connect along with the Facebook Graph API to fetch user's email addresses when they sign up to my site. This works perfectly over 99% of the time but sometimes when I query the Graph API for a user's data after they have given my site permission, including the email permission, Facebook returns a large number (eg. 14036774009) as the person's email address.

So far, the numbers are always different and are always 11 digits long and all the other user data from the Graph API is valid. I've never been able to replicate this problem with a Facebook account that I control.

In some ways, the large number reminds me of the random proxy email addresses that Facebook generates for people who opt to give 3rd party apps a forwarding address instead of their main address (the proxy addresses look something like this: apps+148742679521093.617890126.8a2b26037e1ccd06bb81aaec5925f4c7@proxymail.facebook.com)

Can anyone explain this behavior or a way to fix it (and always get valid email addresses)?

like image 807
scyclops Avatar asked Nov 03 '22 22:11

scyclops


1 Answers

It's a bug. Has already been reported to Facebook:

https://developers.facebook.com/bugs/298946933534016

It seems to be happening even when using the graph explorer - https://developers.facebook.com/tools/explorer, but only for some users. In my case about 0.2% of the time.

So until it is fixed you have 2 options:

  • If Facebook gives you a bad email value, ask the user for his/her email manually.
  • Save the long lived access token and try again periodically to see if you get the correct email back.
like image 135
Mike Avatar answered Nov 09 '22 07:11

Mike