I am trying to Access users friends information using access token.
So i create a facebook object.
$facebook = new Facebook(array(
'appId' => APP_ID,
'secret' => APP_SECRET,
));
I then set the access token to that object.
$facebook->setAccessToken(TOKEN);
Then when i try to retrieve the user information it returns 0.
$user = $facebook->getUser();
So the code below does not get executed.
if ($user)
{
try
{
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
}
catch (FacebookApiException $e)
{
error_log($e);
$user = null;
}
}
Can anyone tell me where my mistake lies.