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

两盒软妹~` 提交于 2019-12-10 13:24:12

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/33195655/how-to-get-who-invited-using-facebook-app-invite-sdk-for-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!