我尝试使用facebook图形api资源管理器发布到一个Feed(我正在通过它获取令牌)。
通常,当您在Feed中手动发布链接时,会创建摘要。当我通过graph explorer api app发布链接时,它会显示为常规链接。
enter code here
$graph_url = "https://graph.facebook.com/".$_POST['group_id']."/feed";
$postData = array(
'access_token' => $_POST['token'],
'message' => $_POST['message'],
'name' => 'name',
'picture' => urlencode ('http://wildfireapp.files.wordpress.com/2010/05/img-payingfbcustomers1.png'),
'link' => urlencode ('http://www.google.com'),
'scope' => 'publish_stream');
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $graph_url,
CURLOPT_POSTFIELDS => $postData,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_VERBOSE => true
));
$result = json_decode(curl_exec($ch));
curl_close($ch);