在我的Facebook应用程序粉丝页面上发布一个Feed [英] post a feed on my facebook application fan page

查看:72
本文介绍了在我的Facebook应用程序粉丝页面上发布一个Feed的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何在我的墙上张贴一些东西 $ facebook-> api('/ me / feed /','post',$ feed);
但如何在我的Facebook应用页面上发布Feed,此Feed必须由应用发布

解决方案

你去:

  //我们需要先获得一个应用程序access_token 
$ 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);

//分隔返回的字符串在后置数组中使用它
$ arr = explode(=,$ app_token);
$ app_token = $ arr [1];

$ post_id = $ facebook-> api(/ $ app_id / feed,POST,array(access_token=> $ app_token,message=& !));


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

这篇关于在我的Facebook应用程序粉丝页面上发布一个Feed的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆