你好,我創建了一個API直接發佈,它在我的臉書上的配置文件工作得很好,當我嘗試在我的頁面發佈狀態時,狀態是好的,帖子在遊客出版物中發生了什麼我做 ?Facebook的SDK狀態/頁
我看着Facebook Graph API,這似乎是一個錯誤..你可以繞過使用Curl ..?
PS /我編輯的信息頁ID,應用程序ID,祕密應用
預先感謝您的幫助 史蒂芬妮
public function statutPage(){
$fb = new Facebook([
'app_id' => 'my app id',
'app_secret' => 'my app secret',
'default_graph_version' => 'v2.8',
]);
$pageID='my page id,;
$token='A_VALID_USER_ACCESS_TOKEN';
$attachment = [
'access_token' => $token,
'message' => 'Premier message auto',
'name' => 'Première publication sur facebook',
'caption' => 'Legend sous le tire',
'link' => 'https://www.la-programmation.surleweb-france.fr',
'description' => 'Description du lien',
'picture' => 'https://www.google.fr/images/srpr/logo11w.png'
];
try {
$response = $fb->post('/'.$pageID.'/feed/', $attachment);
} catch(FacebookAuthorizationException $e) {
echo 'Graph retourne une erreur: ' . $e->getMessage();
exit;
} catch(FacebookSDKException $e) {
echo 'Facebook SDK retourne une erreur: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
echo 'Posté su Facebook avec l\'id: ' . $graphNode['id'];
}
請編輯您的問題以提供一些'代碼樣本** **和**提供您想要實現的場景。同時查看Facebook Graph API文檔本身。可能需要提供替代參數以達到您想要的效果。 –
_「我看着Facebook Graph API,看起來這是一個錯誤」 - - 廢話。事實上,你沒有仔細閱讀文檔。 https://developers.facebook.com/docs/graph-api/reference/v2.8/page/feed#publish – CBroe
感謝您的回覆,我閱讀並重新閱讀了文檔,但這不適用於網頁...在配置文件沒有問題!目前我還沒有找到解決方案發佈一個頁面上的狀態... –