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
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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!"));