According to the Facebook docs, using App_access_token
is as simple as:
$appid = 'xxx';
$secret = 'yyyyyyyyy';
$facebook = new Facebook(array(
'appId' => $appid,
'secret' => $secret,
'cookie' => true,
));
$session = $facebook->getUser()>0;
if($session){
$access_token = 'access_token='.$facebook->getAccessToken();
$app_access_token = file_get_contents("https://graph.facebook.com/oauth/access_token?client_id=$appid&client_secret=$secret&grant_type=client_credentials");
}
My problem is that $access_token
is fine but $app_access_token
always returns false, what am I doing wrong?
-EDIT-
If I open the app_access_token
URL in my browser I can see the access token! It seems to fail the file_get_contents... ?