Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Callback JSON does not return email sometimes

Facebook Graph API.

I am requesting email permission and it works all fine except for some users, the json does not return email field. I am not sure why this happens. The code is same and it works great for all users, returns email field except 1 in 100 or so users where it does not have this field in json. All other fields are there.

Has anyone faced this problem before ??

I checked the facebook privacy settings and there is nothing that prevents email from coming in json if user grants email access to facebook app, yet this is happening to me. I searched the net and no one else seems to be facing this issue.

Any hint would be appreciated

like image 956
zing ming Avatar asked Apr 06 '11 18:04

zing ming


1 Answers

Never makes assumptions about what Facebook will send you, never expect every field to be present and never expect a Graph request to do what you want.

Facebook sometimes do things like this, a missing field here and there, a cryptic and unexpected error somewhere else… While it can be no harm be aware that it also happens in critial places like in the signed_request sent when an user launches an app.

You also have to know that 'your' Facebook may not be everyone else's Facebook. They do geographic and somewhat random deployments of their code. An option to hide your e-mail address to every application could appear for someone but not for someone else, without any particular reason.

Considering your particular issue, I doubt there is an option to hide you e-mail address to an app who has the mail permission, but if the permission is not mandatory someone could accept your app and cherry-pick optional permissions later.

like image 98
L-P Avatar answered Oct 15 '22 18:10

L-P