我使用图形版本2.5编写Facebook应用程序这个应用程序应该在成员时间线发布它工作正常,但当我添加图像URL发布内容时,它显示为链接。与粘贴在帖子内容中显示为缩略图的图片或视频的网址时不一样 这是我的post.php页面
<?PHP
session_start();
include("connection.php");
require_once __DIR__ . '/sdk/src/Facebook/autoload.php';
$fb = new Facebook\Facebook([
'app_id' => 'APP_ID',
'app_secret' => 'APP_SECRET',
'default_graph_version' => 'v2.5',
]);
$getToken=$mysqli->query("select uid,accessToken from users");
while($token=mysqli_fetch_array($getToken)){
echo $token['accessToken'];
echo "<br>".$token['uid'];
try {
$params = array(
"message" => "this is a test for adding post wiht image URL using facebook Application http://mcq-tests.com/athcar/images/cartoon.jpg ",
"name" => "How to Auto Post on Facebook with PHP",
"caption" => "www.meem-tech.com",
"description" => "Automatically post on Facebook with PHP using Facebook PHP SDK. How to create a Facebook app. Obtain and extend Facebook access tokens. Cron automation."
);
$ret=$fb->post('/'.$token['uid'].'/feed',$params,$token['accessToken']);
echo 'Successfully posted to Facebook';
} catch(Exception $e) {
echo $e->getMessage();
}
}
?>
如果我使用Facebook应用程序发布帖子,这就是我得到的
如果我在Facebook时间线中手动粘贴图片网址,这就是我所得到的
所以我的问题是如何让我的应用以手动方式显示图片或视频