Since the application for Facebook applications is based on AppLinks , this is where you need to look for a solution. I will explain this with an Android script.
When you create an application invitation ( using a dialog ), you specify the AppLinks URL. This URL can be unique to each user who sends invitations, or even to each individual invitation. For example: https://www.example.com/invite_applink?invite_id=12345 . By creating one AppLink URL for, for example, every user who invites others, you insert the sending invitation attribute (thatβs exactly what you want to say) into your AppLinks URL.
As the Facebook application shows, how to open the application from the "Applications Invites " section, following the AppLinks specification . This specification states that the <head> section of the HTML document, which is located at https://www.example.com/invite_applink , must contain relevant <meta> data that describes how your application can be openly / deeply connected. One of them is the al:android:url property, which can be used as follows: <meta property="al:android:url" content="example://invite_from_fb?invite_id=12345" />
Notice how the url contains the invite_id=12345 parameter, where 12345 is the same value as the value specified in the invite_id parameter of the invite_id URL above. When the invited user now opens the application from the URI with a deep link example://invite_from_fb?invite_id=12345 , the application will be opened from the intent containing this information.
When your Activity application opens, you can capture the Intent that opened the Activity and received from it the Uri that was used to open the application: Intent.getData() . Read more about this in the Android docs on " " Allow other apps to launch your activity "
At this point, the identifier that ascribes the invitation to the user to the user made the sender in the running recipient application. Now the application on the recipient device should call your server and tell him what invitation the invitation was invited to. In order to avoid that several of these attributes come from the same user (who may have received invitations from several people), you can pause sending attribution data until the user logs in (for example, Facebook Login), and you can ignore for example all attributes after the first.
source share