在 Facebook 的墙贴中添加自定义按钮

发布于 2024-12-04 11:13:18 字数 202 浏览 2 评论 0原文

我在构建 Facebook 应用程序方面非常天真。我需要在用户墙上发帖,为此我需要在 FB 的“赞”和“评论”按钮旁边嵌入一个自定义按钮。

我研究了一下,发现应该使用 FBML,但没有找到实现该目标的确切方法。我还找到了 fb:create-buttonfb:dashboard ,但是也无法弄清楚要使用的确切流程。

I 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烟酒忠诚 2024-12-11 11:13:18

不,我会为你设计按钮伙伴,并对 JS SDK FB.ui 函数执行 onclick,如下所示
您必须实例化一个 FB 对象,您可以在此处找到有关该对象的所有信息
http://developers.facebook.com/docs/reference/javascript/

[代码]

 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.');
    }
  }
 );
}

[/代码]

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]

囚我心虐我身 2024-12-11 11:13:18

我为使用 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'
                                                           ),
                                          ));

希望这有帮助!

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!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文