Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在创建一个使用 apprequest 的 Facebook 应用程序,这样玩家也可以邀请他们的朋友一起玩。我希望能够在他们邀请的人接受他们的邀请并开始使用该应用程序时向玩家奖励积分。我可以从接受邀请的新玩家那里检索 request_id,有没有办法可以使用这个 request_id 来获取发送 apprequest 的玩家的用户 ID?
对于可能有类似问题并且不想花费数小时阅读 Facebook 文档的其他人,他们发现这可以通过几行代码非常简单地完成:
$ret = $facebook->api("/$request_id", 'GET'); $inviterId = $ret['from']['id'];
希望它可以帮助某人。
是http://developers.facebook.com/docs/reference/dialogs/requests/