This may not be the answer you were hoping for, but I think it will help realize your requirements.
Part 1: Data sent directly via AppInvite
As far as I know, you can not send user data with AppInvites , created with AppInviteContent.Builder . I'll explain more advanced features in Part 3. But, perhaps, GameRequest is for you to do this. A GameRequestDialog can be initialized using the object GameRequestContent . The method setData class GameRequestContent.Builder "sets additional data that can be used to keep track of."
Part 2: tracking invitations
Of course, you can keep track of what the user has opened AppInviteDialog (by doing a simple query on your server). Unfortunately, it is impossible to keep track of how much or how many users requested.
But after the invited user accepts the invitation, install and run a mobile application (or give you permission to the canvas, if you also have an application for the canvas), you can get all AppRequests (invite) to execute a query /me/apprequests using Graph the API .
It is also possible:
- Appendix Canvas: request for
POST , your server will receive after visiting a user opens a canvas page contains a parameter request_ids . This is a list with commas the app-request-ids , which can be used in the query graph. - Mobile application: after visiting the user has installed and launched the application in response to AppRequest, you can get app-request-ids on the intention or by
AppLinkData.fetchDeferredAppLinkData and appLinkData.getTargetUri().getQueryParameter("request_ids") . See. Section "Supporting inbound links" in the documentation. Now you can create an api schedule request.
Part 3: sending data using AppInvite via App-Link
As shown in Section 2.2., You get targetUrl after visiting a user opens the app. This targetUrl Set in AppLink , found in AppLinkUrl , you used to AppInvite. Use the "Endpoint dynamic applications" you can send the invitations. Here is an idea how to implement this:
- Your server determines the endpoint to the template the uri
POST:http://example.com/users/${USER}/invites/ . $ {USER} is the username of the sender of the invitation. - Before creating the invitation dialog box, the client sends a POST request to the endpoint from step 1 and receives a UUID as a response that refers to the scheduled invitation and the user.
- the server determines the second end point of
GET:http://example.com/users/${USER}/invites/${UUID} . The answer to this endpoint - a page with a specific AppLink, where al:android:url is example://users/${USER}/invites/${UUID} - Of course, placeholder $ {USER} and $ {UUID} replaced correct values from step 1 and 2. - The client uses the endpoint from step 3 (
http://example.com/users/${USER}/invites/${UUID} ) as an URL-address when creating applications AppInviteContent. - The invited user accepts the invitation and opens the application. Now we can get the UUID of targetUrl (see. Step 2.2 / "Support of inbound links" ).
source share