Take the 2-minute tour ×

I am using the Graph API and able to get users' email addresses successfully.

I am wondering if i can assume that i will ALWAYS get a user's email address back, or if i need to plan for some fringe scenario where the user's permissions are set or something and i will be unable to get the user's email address.


share|improve this question
always code defensively –  Forty-Two Jan 7 '13 at 16:35
@Forty-Two defensive coding is great, but when the defensive solution requires a revised design that adds non-trivial development time across a few different platforms plus testing time "just in case," i'd like to weigh my options –  jaminto Jan 8 '13 at 19:01
add comment

1 Answer

As long as you ask for the email permission and that the user accept it, you'll always get the user email. However, you'll need to foresee the case where the user don't accept it.

share|improve this answer
Also the case, when user have not shared his/her email with anyone. Rare but can happen, so code defensively as Forty-Two said. –  Sahil Mittal Jan 7 '13 at 16:46
No. In that case, the API will still be able to retrieve the email. –  Stéphane Bruckert Jan 7 '13 at 16:48
My bad. Of course it will. :) –  Sahil Mittal Jan 7 '13 at 17:06
But still, some users have incurred the "blank" email issue but not sure why. Ref: github.com/mkdynamic/omniauth-facebook/issues/61 –  Sahil Mittal Jan 7 '13 at 17:11
That's what i'm not clear on - if i request an access token like: graph.facebook.com/oauth/… the FB dialog says the app will get access to my basic info and email and i can either login or cancel. it's not like "online presence" where it's a permission the user can deny - it's all or nothing. where is the case where i would get an access token but no email? –  jaminto Jan 8 '13 at 19:13
add comment

Your Answer


