Facebook应用请求信息 [英] Facebook app request information

查看:106
本文介绍了Facebook应用请求信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个使用apprequest的Facebook应用程序,以便玩家可以邀请他们的边缘玩。当他们邀请的人接受邀请并开始使用该应用程序时,我希望能够向玩家奖励积分。我可以从接受邀请的新播放器中检索request_id,有没有办法可以使用这个request_id来获取发送apprequest的播放器的用户ID?

I am creating a Facebook app that uses apprequest so players can invite their frineds to play aswell. I want to be able to award points to players when people they have invited accept their invitation and start using the app too. I can retreive the request_id from the new player accepting the the invitation, is there a way I can then use this request_id to get the user id of the player that sent the apprequest?

推荐答案

对于任何可能有类似问题,不想花时间通过Facebook文档工作的人,发现只要几行就可以完成的代码:

For anyone else who might have a similar problem and doesn't want to spend hours working their way through the Facebook documentation have found this can be done quite simply with just a couple of lines of code:

    $ret = $facebook->api("/$request_id", 'GET');
    $inviterId = $ret['from']['id'];

希望它帮助某人。

这篇关于Facebook应用请求信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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