Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook API post to feed with Bigger image?

I tried to share posts automatically to my facebook page. It works perfectly, but I want to use bigger image to the shared post. http://cdn.tips4php.net/wp-content/uploads/2010/12/final_post.jpg

I used the following code to post it:

 try {
 $page_info = $facebook->api("/$pageId?fields=access_token");

 $attachment = array(
 'access_token' => $MYACCESTOKEN,
 'message' => $msg,
 'name' => $title,
 'link' => $uri,
 'description' => $desc,
 'picture'=>$pic,
 'actions' => json_encode(array('name' => $action_name,'link' => $action_link))
 );

$status = $facebook->api("/$pageId/feed", "post", $attachment);

 } catch (FacebookApiException $e) {
 error_log($e);
 $user = null;
 }

How can I use bigger picture to this post? I saw a few shared post from other facebook pages and they have large picture. Waiting for your answer..

like image 604
Nagy András Avatar asked Nov 12 '22 10:11

Nagy András


1 Answers

The larger image is only displayed if the image / post was shared manually by an administrator. If you use the API, Facebook deliberately use the smaller image. Basically, Facebook want to promote manual sharing of content as opposed to automatic sharing.

Of the examples you've seen, do any of them have the "via xxx app" on them, like your screenshot? This is a giveaway on if the post was shared manually or via an application.

like image 196
Niraj Shah Avatar answered Nov 15 '22 11:11

Niraj Shah