检索Facebook App邀请者的用户ID [英] Retrieve User ID of Facebook App Invitor

查看:96
本文介绍了检索Facebook App邀请者的用户ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在给定的Facebook应用程序的上下文中,假设用户A邀请用户B开始使用它.用户B接受使用该应用程序后,是否有任何方法以编程方式(通过PHP/JS SDK)检索用户A的ID?似乎没有足够的记录.

In the context of a given Facebook app, suppose User A invited user B to start using it. Once User B accepts to use the app, is there any way to retrieve the ID of User A programmatically (via either PHP/JS SDK) ? This doesn't seem quite documented.

就其价值而言,A/B用户是朋友,如果有什么用.

For what it's worth, A/B users are friends, if it's any use.

推荐答案

当用户关注应用程序请求时,您可以使用

when user comes following the app request, you can get request id's using

$_GET['request_ids']

然后检索所有可调用图api的请求ID,以获取相应的请求详细信息,如下所示:

then retrieve all the request ids with which you can call graph api to get the corresponding request details like below:

if(isset($_GET['request_ids']))
     {
          $request_ids = $_GET['request_ids'];
      }
$request_ids = explode(",", $request_ids);
foreach($request_ids as $request_id)
       {
            $request_object = $facebook->api($request_id);
             //this $request_object have sender facebook id in the field uid_from
        }

这篇关于检索Facebook App邀请者的用户ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆