Search code examples
facebookinviteinvitationfacebook-app-requests

How to get user who invited a friend?


My website has a sponsorship system that allows users to invite friends by email (with a link that refers sender) because of some bonus ("if X people subscribe because of you, you win this and that"). I want to do the same with the Facebook side of the application, so I use the 'apprequest' method to bring a list of friends to invite, but I wonder how can I get the sender/new subscriber association. It seems I can know that A (member) invited B (not a member) with the response request, so I could say "A invited B, if B subscribes then A is B's sponsor". But if A and C invited B, how can I know what of both invitations B has chosen ?


Solution

  • Have a quick read of the Request dialog docs: https://developers.facebook.com/docs/reference/dialogs/requests/

    data: Optional, additional data you may pass for tracking. This will be stored as part of the request objects created. The maximum length is 255 characters.

    So in your request you can add the UID of the user sending the invite thus allowing you to work out who invited user B.