After the application is invited, the invitation clicks on the link. Based on an already installed application, it will be redirected to the application store and finally come to Actiity, which processes the AppInite link.
My deep link looks like this:
http://example.com/app-invite/
Where user_id is the ID of the registered user (on my backend server). I can get the correct user id.
This is the code for handling deep links.
private void processReferralIntent(Intent intent) {
String invitationId = AppInviteReferral.getInvitationId(intent);
String deepLink = AppInviteReferral.getDeepLink(intent);
String userId = deepLink.substring(deepLink.lastIndexOf("/") + 1);
Utility.displayToast("userid " + userId);
Log.d(TAG, "Found Referral: " + invitationId + ":" + deepLink);
((TextView) findViewById(R.id.deep_link_text))
.setText(getString(R.string.deep_link_fmt, deepLink));
((TextView) findViewById(R.id.invitation_id_text))
.setText(getString(R.string.invitation_id_fmt, invitationId));
}
Now, if this is the first time the invitation installs the application by clicking on the link to the applicationโs invitation, I want to provide some advertising loans to both invitees and invitations.
, ? Beacuse alredy processReferralIntent() .