如何将分享/邀请功能集成到粉丝专页自定义选项卡中

发布于 2024-12-27 18:18:15 字数 307 浏览 1 评论 0原文

我只是想知道如何将共享/邀请功能集成到自定义 Facebook 选项卡中。

我的目的是开发一个按钮“邀请朋友加入 XXX 粉丝专页”。

我已经创建了一个 HTML 页面,用作 facebook 的自定义选项卡。

当前页面位于此处

如有任何帮助,我们将不胜感激。

干杯,

J.

I was just wondering how I could integrate a share/invite function into a custom facebook tab.

My purpose is to dev a button "invite friends to the XXX fanpage."

I already created an HTML page that I use as a custom tab for facebook.

The current page is here

Any help would be much appreciated.

Cheers,

J.

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

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

发布评论

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

评论(1

双马尾 2025-01-03 18:18:15

您的APP ID:275339329168531
您的页面网址:http://www.facebook.com/pages/Salon-Babyboom/237448289650901

每:https://developers.facebook.com/docs/reference/dialogs/requests/

您只能邀请人们使用应用程序。所以这将是进行应用程序邀请的代码。

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:fb="https://www.facebook.com/2008/fbml">
  <head>
    <title>Request Tester C</title>
  </head>

  <body>
    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js"></script>
    <p>
      <input type="button"
        onclick="sendRequestToRecipients(); return false;"
        value="Send Request to Users Directly"
      />
      <input type="text" value="User ID" name="user_ids" />
      </p>
    <p>
    <input type="button"
      onclick="sendRequestViaMultiFriendSelector(); return false;"
      value="Send Request to Many Users with MFS"
    />
    </p>

    <script>
      FB.init({
        appId  : '275339329168531',
        status : true,
        cookie : true,
        oauth: true
      });

      function sendRequestToRecipients() {
        var user_ids = document.getElementsByName("user_ids")[0].value;
        FB.ui({method: 'apprequests',
          message: 'My Great Request',
          to: user_ids, 
        }, requestCallback);
      }

      function sendRequestViaMultiFriendSelector() {
        FB.ui({method: 'apprequests',
          message: 'My Great Request'
        }, requestCallback);
      }

      function requestCallback(response) {
        // Handle callback here
      }
    </script>
  </body>
</html>

要“分享”粉丝专页,您将使用 Like Box 插件来完成此操作。

请参阅:http://developers.facebook.com/docs/reference/plugins/类似框/

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=275339329168531";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like-box" data-href="http://www.facebook.com/pages/Salon-Babyboom/237448289650901" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>

Your APP ID: 275339329168531
Your Page URL: http://www.facebook.com/pages/Salon-Babyboom/237448289650901

Per: https://developers.facebook.com/docs/reference/dialogs/requests/

You can only invite people to use an application. So this would be the code to do an app invite.

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:fb="https://www.facebook.com/2008/fbml">
  <head>
    <title>Request Tester C</title>
  </head>

  <body>
    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js"></script>
    <p>
      <input type="button"
        onclick="sendRequestToRecipients(); return false;"
        value="Send Request to Users Directly"
      />
      <input type="text" value="User ID" name="user_ids" />
      </p>
    <p>
    <input type="button"
      onclick="sendRequestViaMultiFriendSelector(); return false;"
      value="Send Request to Many Users with MFS"
    />
    </p>

    <script>
      FB.init({
        appId  : '275339329168531',
        status : true,
        cookie : true,
        oauth: true
      });

      function sendRequestToRecipients() {
        var user_ids = document.getElementsByName("user_ids")[0].value;
        FB.ui({method: 'apprequests',
          message: 'My Great Request',
          to: user_ids, 
        }, requestCallback);
      }

      function sendRequestViaMultiFriendSelector() {
        FB.ui({method: 'apprequests',
          message: 'My Great Request'
        }, requestCallback);
      }

      function requestCallback(response) {
        // Handle callback here
      }
    </script>
  </body>
</html>

To "Share" a fanpage, you will use the Like Box plugin to do that.

See: http://developers.facebook.com/docs/reference/plugins/like-box/

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=275339329168531";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like-box" data-href="http://www.facebook.com/pages/Salon-Babyboom/237448289650901" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文