Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // [START get_deep_link]
- // Check if this app was launched from a deep link. Setting autoLaunchDeepLink to true
- // would automatically launch the deep link if one is found.
- boolean autoLaunchDeepLink = false;
- AppInvite.AppInviteApi.getInvitation(client2, this, autoLaunchDeepLink)
- .setResultCallback(
- new ResultCallback<AppInviteInvitationResult>() {
- @Override
- public void onResult(@NonNull AppInviteInvitationResult result) {
- if (result.getStatus().isSuccess()) {
- // Extract deep link from Intent
- Intent intent = result.getInvitationIntent();
- String deepLink = AppInviteReferral.getDeepLink(intent);
- Log.d("invite_code", deepLink);
- Intent i = new Intent(getApplicationContext(), Referral.class);
- startActivity(i);
- // Handle the deep link. For example, open the linked
- // content, or apply promotional credit to the user's
- // account.
- // [START_EXCLUDE]
- // Display deep link in the UI
- //((TextView) findViewById(R.id.link_view_receive)).setText(deepLink);
- // [END_EXCLUDE]
- } else {
- Log.d("firebase_invite", "getInvitation: no deep link found.");
- }
- }
- });
- // [END get_deep_link]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement