开发者

Add Custom button in the Wall Post of Facebook

I开发者_如何学C am pretty naive in building Fb apps. I need to post on the user's wall for which I need to embed a custom button along the side of Like and Comment button of FB.

I researched a bit and found out FBML shall be used but did not get the exact way to reach that.I also found fb:create-button and fb:dashboard , but also was not able to figure out the exact flow to use.


nah i would design you button mate, and do a onclick to a JS SDK FB.ui function like below You would have to instantiate an FB object which you can find all about here http://developers.facebook.com/docs/reference/javascript/

[code]

 function publish_stream() {
  FB.ui(
   {
     method: 'feed',
     name: 'your publish stream name',
     link: 'http://apps.facebook.com/appname',
     picture: 'http://yourimage dir/f1.jpg',
     caption: 'Reference Documentation',
     description: 'blah blah blah'
  },
  function(response) {
    if (response && response.post_id) {
      alert('Post was published.');
    } else {
      alert('Post was not published.');
    }
  }
 );
}

[/code]


I found another solution for the people using PHP SDK:

$ret_obj = $facebook->api('/680066819/feed', 'POST',array(
                                          'link' => 'www.google.com',
                                          'message' => 'posted',
                                          'description' => "I am bond",
                                          'actions' => array(
                                                          'name' => 'button name',
                                                          'link' => 'your link'
                                                           ),
                                          ));

Hope this helps!!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜