当我向页面发布消息时,它可以正常工作,但是,如果我向$ data数组添加一个链接参数,则会返回错误。
有人经历过这个吗?
$fb = new Facebook\Facebook([
'app_id' => $config['app_id'],
'app_secret' => $config['app_secret'],
'default_graph_version' => 'v2.8',
]);
$access_token = "12345";
$fb->setDefaultAccessToken($access_token);
$data = [
"message" => "hello",
"link" => "www.bbc.co.uk"
];
$page_id = 123;
try {
$response = $fb->post('/' . $page_id . '/feed', $data);
} 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;
}
print_r($response);