Something gone wrong with my php code for retrieve facebook information. My android app has facebook login integrated, so user can login and identify itself with his facebook Account. Login goes well, so i'm able to retrieve his name from token and save it into database. Now i have a problem while i try to retrieve some more information by using the same token. I would retrieve user id and his picture. This is my code:
try {
$request = new FacebookRequest($session, 'GET', '/me');
$fb_response = $request->execute();
$graphObject = $fb_response->getGraphObject();
print_r($graphObject);
echo'<br>';
$username = $graphObject->getProperty('name');
echo $username . '<br>';
$id = $graphObject->getProperty('id');
} catch (Exception $e) {
echo'Error';
echo $e;
}
But when i launch script, nothing is printed (no exception too). What's wrong?
Aucun commentaire:
Enregistrer un commentaire