使用facebook php sdk在左侧发布照片并在右侧发表评论[关闭]

I am working on a app, it almost nearing completion. i want to post a image related to my app with comment on the users wall when user uses my app. i have seen so many apps on FB, which post image with comment, just like a invitation card, so that users friends can also use it .so can anyone help me on this

thanks in advance

First things first, make sure the following permission is obtained:

publish_stream

Now, assuming you have created a $facebook object using the SDK, you can then post to the stream including a picture on the lefthand side:

$attachment = array
(
'access_token'=>$facebook->getAccessToken(),
'message' => 'This is the message',
'name' => 'NAME',
'caption' => 'This is my caption:',
'description' => 'This is the description',
'picture' => 'http://www.facebookanswers.co.uk/img/misc/iq.jpg'
);
$result = $facebook->api($this->id.'/feed/','post',$attachment);

The message field can be omitted if you want. I have included it so that at least you know it is there.

You need to change the contents of the fields to suit your needs, but hopefully you get the picture.