0

I have web app running in Google App Engine/Java. The app allows user to login using their facebook account.

The implementation works perfectly but sometimes an error happened and said no email in API response.

Email is already included in scope: scope = "email,user_birthday,user_location";

I explicitly required email:

"https://graph.facebook.com/me?access_token=" + accessToken + "&fields=email,id,name,birthday,gender";

But still API sometimes don't have email returned. How to reproduce the error with my facebook account?

When will the response don't include email? Is email not required in all facebook registraion? Any workaround for this?

JR Galia
  • 17,229
  • 19
  • 92
  • 144
  • Did you check the condition when the user has a valid Facebook login but rejects to give your app the necessary permissions? If you have provided an url, on reject facebook redirects the user to the page, with only basic information about the user, ofcourse with no email data in it. – Ozan Tabak May 13 '13 at 08:08
  • how to check it? Can u give me an idea? – JR Galia May 13 '13 at 08:10
  • login to facebook, remove the app's privileges from your account, then goto your app, when it asks for permissions reject it and see if the error occurs. – Ozan Tabak May 13 '13 at 08:14
  • the error didn't occur, just redirected to the original page with facebook button – JR Galia May 13 '13 at 08:27
  • I believe your answer is here: http://stackoverflow.com/questions/7603644/intermittent-missing-email-address-in-facebook-api – Ozan Tabak May 13 '13 at 08:32
  • Having same issue with our App. Both iOS and Android is returning the me graph request without the email address although it's beeing requested and actually user has granted access to that – Lefteris May 23 '13 at 02:59
  • @Lefteris, pls let me know if you find any workaround... thanks... – JR Galia May 23 '13 at 03:07
  • Trying to find out what's going on, although I think this is a generic issue as trying to log into other apps using fb seems to be failing on Android... – Lefteris May 23 '13 at 03:09
  • still getting this error... hope to hear any fix – JR Galia Jun 04 '13 at 00:58

1 Answers1

0

This is a very old question, but the issue is likely the user doesn't have an email. Facebook allows users to signup with just a phone number so a growing percent of users do not have an email associated with their account.

More info: https://developers.facebook.com/docs/facebook-login/permissions#reference-email

Ryan C
  • 1,003
  • 1
  • 14
  • 26