Facebook app request information

2019-06-13 06:20发布

问题:

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?

回答1:

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.



回答2:

yes http://developers.facebook.com/docs/reference/dialogs/requests/