有没有办法将图像发送到Facebook用户的墙上?要发布文本,我使用以下代码:
$arpost = array(
'message' => $text,
'access_token' => $token
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($arpost));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
curl_close($ch);
对于后代:http://developers.facebook.com/docs/reference/api/post/< - param被称为图片,所以你这样做:
$args = array(
'message' => $text,
'picture' => $link2picture
);
$this->_facebook->api('/me/feed/', 'post', $args);
答案 0 :(得分:0)
以下是使用Java进行此操作的链接...也许您可以将其用于某些想法。
Android - Upload photo to Facebook with Facebook Android SDK
检查facebook php sdk。它应该在那里。