views:

397

answers:

2

I tried below code not working

$attachment = array('message' => 'some meesgae', 'name' => 'This is my demo Facebook application!', 'caption' => "Caption of the Post", 'link' => 'http://mylink.com', 'description' => 'this is a description', 'picture' => 'http://mysite.com/pic.gif', 'actions' => array(array('name' => 'Get Search',     'link' => 'http://www.google.com')) );


$result = $facebook->api('/me/feed/','post',$attachment);

And i given the extended permission "publish_stream"

 $loginUrl = $facebook->getLoginUrl(array('req_perms' => 'email,user_birthday,status_update,publish_stream'));
A: 

You need to JSON encode the attachment:

$attachment = json_encode($attachment);

Also, action_links are not supported by the Graph Api, only the following parameters are supported:

message      The message 
picture      If available, a link to the picture included with this post 
link            The link attached to this post 
name            The name of the link 
caption      The caption of the link (appears beneath the link name) 
description  A description of the link (appears beneath the link caption) 
source        If available, the source link attached to this post (for example, a flash or video file)
BeRecursive
need to attached more picture nearly 5 friends images in wall
Elankeeran
Sorry i don't quite understand?
BeRecursive
A: 

BeRecursive is right about the action links, but the $facebook-api function does the json encoding for you, and you can also send in "cb" which is a callback function.

Trey