Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not getting email from facebook API while login

I have a problem while login i can't get email even while adding email to User & Friend Permissions (for some facebook accounts).

i'm using facebook-php-sdk, this the code that im using

$facebook_user_profile = $facebook->api('/me', array('fields' => 'id,email,first_name,last_name,picture'));

please can any one save my day ?

like image 741
Haithem Rihane Avatar asked Jul 23 '13 11:07

Haithem Rihane


People also ask

How do I retrieve emails from Facebook?

Use Lookup-ID.com to get the user ID of any profile or the Fan page. Enter that ID in the Mailbiz search bar and click on the EXTRACT button and the tool will start extracting emails from the Facebook accounts. You will also receive names, contact numbers, and other details too. Download the list file in .

Does Facebook login use OAuth?

OAuth is also used when giving third-party apps access to accounts like your Twitter, Facebook, Google, or Microsoft accounts. It allows these third-party apps access to parts of your account.


1 Answers

Apart from what CBroe commented about asking for the permissions using the "scope" parameter while logging in to grab permissions, you must also consider the fact that not every logged in user (or a user allowing your application to access their info) has an email assigned to their account.

one can verify their facebook accounts using their Mobile numbers, hence the probability that no email exists. Therefore, when developing an application, take into consideration if a user does not have an email, then you should ask for it manually through a form after login (this is IF the email is necessary for users to use your app).

hope this info helps!

like image 194
Amjo Avatar answered Oct 19 '22 11:10

Amjo