如何添加 facebook“安装应用程序按钮”在粉丝页面选项卡上(基于工作示例)

发布于 2024-08-21 07:40:34 字数 383 浏览 3 评论 0原文

一段时间以来,我试图弄清楚这些人如何能够在他们的粉丝页面选项卡上添加“在线签名”按钮,即“安装应用程序”按钮:

http://www.facebook.com/GuinnessIreland?v=app_165491161181

我在网上阅读过,但找不到任何可靠的解决方案。 FBML 和 FBJS 文档没有给我留下任何东西。

所以,如果有人可以帮助我的话。

注意:要对发送的 Ajax 请求进行多次测试,请勿接受应用程序安装。此后它的行为有所不同。

For some time now I try to figure out how these guys were able to add "Sign online here" button which is "install App" button on their fan-page tab:

http://www.facebook.com/GuinnessIreland?v=app_165491161181

I've read around the web and couldn't come up with any solid solution. The FBML and FBJS documentation left me with nothing.

So please, if anyone can help me with this.

NOTE: To make multiple tests on the Ajax request that are sent, do not accept the App install. It behaves differently after that.

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

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

发布评论

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

评论(1

若沐 2024-08-28 07:40:34

我在了解它时也遇到了一些问题。维基百科或任何地方都没有关于这种行为的信息。在尝试了一些可能的解决方案后,我得到了它,最简单的一个是让用户与粉丝页面选项卡中嵌入的内容进行交互,例如单击某些内容等。然后您需要使用 requirelogin 参数发布 ajax 请求弹出来。简单的例子是:

user_ajax = function() {
  var ajax = new Ajax();
  ajax.responseType = Ajax.RAW;
  ajax.requireLogin = true;
  ajax.ondone = function(data) {
      new Dialog(Dialog.DIALOG_POP).showMessage('Status', data, button_confirm = 'Okay');
  }
  var url = "http://yourappurl.com/request_handler"
  ajax.post(url);
  }

以及它的触发器:

<a href="#" onclick="user_ajax();return false;">Interaction</a>

然后,如果已知用户正在使用您的应用程序(粉丝页面选项卡),您可以通过调用提示他获得其他权限,例如发布流或电子邮件通信:

Facebook.showPermissionDialog('publish_stream,email');

希望这可以解决问题。

I had some problems with finding out about it as well. There is no info about this kind of behavior in wiki or anywhere. I got it working after trying some possible solutions and the simplest one is to make user interact with content embedded in fan page tab such as click on something etc. Then you need to post an ajax request with requirelogin parameter to pop up to come out. The simple example would be:

user_ajax = function() {
  var ajax = new Ajax();
  ajax.responseType = Ajax.RAW;
  ajax.requireLogin = true;
  ajax.ondone = function(data) {
      new Dialog(Dialog.DIALOG_POP).showMessage('Status', data, button_confirm = 'Okay');
  }
  var url = "http://yourappurl.com/request_handler"
  ajax.post(url);
  }

And the trigger for it:

<a href="#" onclick="user_ajax();return false;">Interaction</a>

Then if user is known to be using your application (fan page tab) you can prompt him for additional permission like publish stream or email communication by calling:

Facebook.showPermissionDialog('publish_stream,email');

Hope this solves the problem.

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