0
我想使用Facebook PHP SDK v5自动发布到粉丝页面。我有下面的代码成功发布到我自己的墙上,但我该如何更改代码发布到我的粉丝页面?从我读过的内容中,我需要传入粉丝页面的页面ID?Facebook PHP SDK v5发布到粉丝页面
$params["message"] = 'test';
$params["link"] = 'https://example.com';
$params["picture"] = 'https://example.com/images/logo_hod.jpg';
$params["description"] = 'testtt';
$access_token = $accessToken;
try {
$response = $fb->post('/me/feed', $params, $access_token);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
echo 'Posted with id: ' . $graphNode['id'];
我试图取代这一行:
$response = $fb->post('/me/feed', $params, $access_token);
与此风扇页ID替代:
$response = $fb->post('/229107363768165/feed', $params, $access_token);
,并得到了错误:
Graph returned an error: Unsupported post request.
UPDATE :我也将应用程序“公开”试图超越“不受支持的发布请求”错误。没有运气。