Facebook 好友请求

发布于 2025-01-03 01:59:53 字数 504 浏览 2 评论 0原文

我使用默认的 facebook 对话框来请求请求,

<script type="text/javascript"> 
function sendRequestToRandomFriends() {
  FB.ui({method: 'apprequests',
    message: '<?= na ('request text') ?>',
    to: '<? $to = '';
            foreach ($Rfriends as $c) {
              if (isset($c['uid'])) $to .= $c['uid'] . ',';
            }
            if (!empty($to)) echo substr($to, 0, -1);  ?>'
  }, requestCallback);
} 

但我看到许多自行创建的对话框窗口,要求发送请求。

当用户按下按钮时他们如何发送请求?

I use default facebook dialog to ask for request

<script type="text/javascript"> 
function sendRequestToRandomFriends() {
  FB.ui({method: 'apprequests',
    message: '<?= na ('request text') ?>',
    to: '<? $to = '';
            foreach ($Rfriends as $c) {
              if (isset($c['uid'])) $to .= $c['uid'] . ',';
            }
            if (!empty($to)) echo substr($to, 0, -1);  ?>'
  }, requestCallback);
} 

But I saw many self created dialog windows , which ask to send requests.

How they sends requests when user press the button ?

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

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

发布评论

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

评论(1

野却迷人 2025-01-10 01:59:53

我找到了你的答案。它深深地埋藏在文档中。要在没有 FB.ui 对话框的情况下发送用户请求,您可以使用 grpah api 的 create用户请求发送

创建

您可以通过发出 HTTP POST 请求来为用户发布应用请求
使用应用 access_token 到 /USER_ID/apprequests。

注意:POST 到 /USER_ID/apprequests 的 Graph API 端点是
被视为应用程序对用户请求。应用程序生成的请求不
与以下相比,接收通知并获得有限的分发
通过请求对话框发送的用户到用户请求

I found your answer. It is buried deep down in the documentation. To send a user request without the FB.ui dialog you can use the grpah api's create user request to send.

Create

You can post a apprequest for a user by issuing an HTTP POST request
to /USER_ID/apprequests with the app access_token.

Note: POSTing to the Graph API endpoint of /USER_ID/apprequests is
considered an App to User Request. App-Generated Requests do not
receive notifications and get limited distribution in comparison to
User to User Requests sent with the Request Dialog

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