你好,我创建了一个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
感谢您的回复,我阅读并重新阅读了文档,但这不适用于网页...在配置文件没有问题!目前我还没有找到解决方案发布一个页面上的状态... –