I'm trying to get the user's email address once he's logged into my Android app with Facebook (sdk 4.0). i tested it with 3 facebook account. there is 2 account when i can't get the email address (always null). i want to know , can this be resolved when i submit the application, because until now it's in test mode.
Asked
Active
Viewed 1,542 times
0
-
You must specify the permission to get email. – theapache64 May 18 '15 at 14:54
-
Usually, it's due to the privacy settings of user account. Facebook users can set email as private, so the SDK can't retrieve it. Anyway, @Shifar is right, check if you have specified the right permission – MikeKeepsOnShine May 18 '15 at 14:55
-
i specified it and it's work with some user account. i can get the email address, but when i tried with another account the email return null, maybe the profile is secure. – junior developper May 18 '15 at 14:58
-
@MikeKeepsOnShine exactly that's what i think, so even when the application will be submited i can't get the email address if it's private? – junior developper May 18 '15 at 15:00
-
@junior Right, you can't get it. – MikeKeepsOnShine May 18 '15 at 15:01
-
Have a look at this link, it seems that it can be down to either the user not accepting the confirmation email or if they logged in on the phone http://stackoverflow.com/questions/17532476/facebook-email-field-return-null-even-if-the-email-permission-is-set-and-acce @juniordevelopper It could be that, however the user has to accept that the application will be using certain details. So im not sure it will matter if the account is private if the user is allowing the app to access the account info – Andy Joyce May 18 '15 at 15:03
1 Answers
2
According to this answer suggested by @AndyJoyce(Facebook Email field return null (even if the “email” permission is set and accepted)), probably the user didn't confirmed the email address during the registration.
In the documentation, is specified another scenario: https://developers.facebook.com/docs/facebook-login/permissions#reference-email
Note, even if you request the email permission it is not guaranteed you will get an email address. For example, if someone signed up for Facebook with a phone number instead of an email address, the email field may be empty.

Community
- 1
- 1

MikeKeepsOnShine
- 1,730
- 4
- 23
- 35