I know how to post something on my wall $facebook->api('/me/feed/', 'post', $feed);
but how to post feed on my facebook application page and this feed开发者_开发百科 must be posted by the app
Here you go:
// we need to get an application access_token first
$token_url = "https://graph.facebook.com/oauth/access_token?" .
"client_id=" . $app_id .
"&client_secret=" . $app_secret .
"&grant_type=client_credentials";
$app_token = file_get_contents($token_url);
// seperate the string returned to use it in the post array
$arr = explode("=",$app_token);
$app_token = $arr[1];
$post_id = $facebook->api("/$app_id/feed", "POST", array("access_token"=>$app_token,"message"=>"hello app!"));
精彩评论