post a feed on my facebook application fan page

空扰寡人 提交于 2019-12-06 13:01:07

问题


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!"));


来源:https://stackoverflow.com/questions/4919788/post-a-feed-on-my-facebook-application-fan-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!