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

2

6

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...

Chlorella answered 18/10, 2015 at 8:4 Comment(1)
if you want to work it for you. please submit your app in FB with simulator build than after submit your app , You can be see Invitaion: believe me its should be workEskilstuna
C
2

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.

Chlorella answered 21/10, 2015 at 14:49 Comment(0)
C
0

If the App is already installed on the device, are you getting the identity of the "User" who invited the "Friend"? If yes, how are you doing this?

Secondly, Applink will only pass the information if it is opened through the notification on Facebook, and not directly through the home screen.

Calley answered 21/10, 2015 at 11:14 Comment(7)
If it's already installed I have access to the whole app links data. It's accomplished with this: developers.facebook.com/docs/app-invites/… My only problem is if app is not installed (new install from app store) and that's the solution I'm looking for, get referrer within a new install.Chlorella
The applink data will only work if it is coming from a Facebook notification. The user would need to click on the facebook notification to open the app. If you simply open the app through the home screen, the applink data shows null.Calley
I do understand that but that's not my problem. My problem is "new installs" where my app isn't installed and the "new user" is taken to the App Store. I want to have access to the App Link info after the new install finishes. This is why I'm even looking for some graph api call to retrieve who invited the new user etc.Chlorella
Hmm.. Need some more trials on this. Will post if I hit any breakthrough. Meanwhile, in my code, I am struggling to get the identity of the referrer in applink. I am getting applink data like target_url, accesstoken, etc., but there is no mention of the referrer. Any inputs? I am using fb.me/appid as the appinvite url.Calley
I use a custom scheme. My app gets a unique url from my server. This url has the referrer id etc so when "invited" user taps the invitation the url in the invitation IS the referrer, example: yourappdepplinkurl://{referrer-id}Chlorella
So, if the app is already installed then facebook passes on the url to the app etc and I use the referrer code which is a parameter in the url etc. The problem is with a new install where this url is lost along the way...Chlorella
I think graph api is the best solution, I will query apprequests and use that info to determine who invited whoChlorella

© 2022 - 2024 — McMap. All rights reserved.