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 :我也將應用程序「公開」試圖超越「不受支持的發佈請求」錯誤。沒有運氣。