FB PHP SDK : Can get public details in Localhost but not in Live Server

This code displays complete FB details in localhost but only display id and name in live server.

if ($session){ //if we have the FB session
     //get user data
     $user_profile = (new FacebookRequest($session, 'GET', '/me'));

     $response = $user_profile->execute();
     $graphObject = $response->getGraphObject();

     // print data
     echo  print_r( $graphObject, 1 );
}

Sample Localhost output (Complete Public Details):

FacebookGraphObject Object ( [backingData:protected] => Array ( [id] => 101 [email] => myEmail@gmail.com [first_name] => MyFname [gender] => male [last_name] => MyLName[link] => https://www.facebook.com/app_scoped_user_id/101/ [locale] => en_US [name] => MyFname MyLname [timezone] => 4 [updated_time] => 2015-05-18T05:51:40+0000 [verified] => 1 ) ) 

Sample Live Server Output (Fb Id and Fullname only):

FacebookGraphObject Object ( [backingData:protected] => Array ( [name] => Name LastName [id] => 101 ) )

Permission: All Set

$required_scope     = 'public_profile, email';

Thanks for your help (IA).


Source: facebook

Leave a Reply