Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get "who" invited using Facebook App Invite SDK for iOS?

I've been trying to get the "who" invited someone on my app without success... Looked around FB docs and nothing.

What I mean is: "User??" invites "Friend", "Friend" taps install on the FB dialog which takes him to App Store, where s/he installs my app.

Once the app is installed, the "App Link" seems to not be passed on to my app and I can't find out who is "User??" (the inviter)

IF the app is already installed in the iPhone and the "Friend" clicks "open", then the "App Link" info is passed correctly.

How can I get the identity of "User??" (the inviter) when it's a new install? Is there another way I can do this "server side" etc?

EDIT: I've found how to get apprequests from the new user's FB etc BUT now I have another problem: If two people invite the same "new user" how to know which invite s/he accepted? How can I get status about apprequests? I think I will create another question...

like image 715
Jake Armstrong Avatar asked Oct 18 '15 08:10

Jake Armstrong


1 Answers

So, I've found out how. Once the "new user" installs my app and signs up with his facebook account I can execute this

GraphRequest request = GraphRequest.newGraphPathRequest(
  accessToken,
  "/me/apprequests",
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // process the info received
    }
});

request.executeAsync();

The above code will get all/any apprequests from my app only and I only have to check who sent it etc.

like image 118
Jake Armstrong Avatar answered Oct 05 '22 06:10

Jake Armstrong