使用此代码,
$fb = new Facebook\Facebook([
'app_id' => FB_APP_ID,
'app_secret' => FB_APP_SECRET,
'default_graph_version' => 'v2.9'
]);
//Post property to Facebook
$linkData = [
'link' => 'http://www.example.com/',
'message' => 'test message',
'object_attachment' => 111111111111111
];
try {
$response = $fb->post('/mypageid/feed', $linkData, FB_APP_ACCESS_NON_EXPIRES);
} 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();
我得到了这个结果:
我做错了什么?