Facebook app request information

2019-06-13 06:21发布

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?

2条回答
Rolldiameter
2楼-- · 2019-06-13 06:54

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'];

Hope it helps someone.

查看更多
登录 后发表回答