Facebook Graph Api - 作为管理员发布到粉丝页面

问题描述:

我设置了一个脚本,允许用户在Facebook上的粉丝页面上发布消息。一切正常,但有一个小问题。

I've setup a script which allows users to post messages to a fan page on Facebook. It all works but there's one small issue.

问题:

该帖子被添加到显示发布用户个人帐户的页面Feed中。
我希望它显示页面的帐户(例如当您的页面的管理员说它来自该页面)。我发布的帐户对该页面具有管理员权限,但仍显示为个人信息。

When the post is added to the page feed it displays the posting user's personal account. I would prefer it to show the account of the page (like when you're admin of the page it says it came from that page). The account I'm posting with have admin rights to the page, but it still shows as a personal post.

HTTP POST

$url = "https://graph.facebook.com/PAGE_ID/feed";
$fields = array (
    'message' => urlencode('Hello World'),
    'access_token' => urlencode($access_token)
);

$fields_string = "";
foreach ($fields as $key => $value):
    $fields_string .= $key . '=' . $value . '&';
endforeach;
rtrim($fields_string, '&');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);

$result = curl_exec($ch);
curl_close($ch);


据我所知,在您呼叫 uid (即页面的ID) stream.publishrel =noreferrer> stream.publish

As far as I know, all you have to do is specify a uid (that is, the page's ID) in your call to stream.publish

有一个看看模拟