How to access additional referral parameters on the receiving side in firebase invitations

This is the sending side.

private void onInviteClicked() {

    Map<String, String> referralParams = new HashMap<String, String>();
    referralParams.put("Name", "Devesh Agrawal");
    referralParams.put("id", "1000");

    Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title))
            .setMessage(getString(R.string.invitation_message))
            .setDeepLink(Uri.parse(getString(R.string.invitation_deep_link)))
            .setCustomImage(Uri.parse(getString(R.string.invitation_custom_image)))
            .setCallToActionText(getString(R.string.invitation_cta))
            .setAdditionalReferralParameters(referralParams)
            .build();
    startActivityForResult(intent, REQUEST_INVITE);
}

This is the end of the reception:

private void processReferralIntent(Intent intent) {
    // Extract referral information from the intent
    String invitationId = AppInviteReferral.getInvitationId(intent);
    String deepLink = AppInviteReferral.getDeepLink(intent);

    // Display referral information
    // [START_EXCLUDE]
    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));
    // [END_EXCLUDE]
}

I have the following queries:

  • What is the use of an invitation to end an appointment? can it be used for any purpose?
  • I am sending a map for additionalReferralParameters, how to access these values ​​at the end of the reception?

Please help me with this.

+4
source share
1 answer

I quickly abandoned this idea and suggested that the direction parameters have some other use :-( But I got my data through deep links:

: https://github.com/firebase/quickstart-android/issues/133 "@droidwala , , "

Uri deepLink = Uri.parse(getString(R.string.invitation_uri));
Uri deepLinkPlus = Uri.withAppendedPath(deepLink, family.getUid());
Intent intent = new AppInviteInvitation.IntentBuilder(...)
                         .setDeepLink(deepLinkPlus);

AppInvite.AppInviteApi.getInvitation callback

Uri deepLink = Uri.parse(AppInviteReferral.getDeepLink(intent));
String uid = deepLink.getLastPathSegment();
0

All Articles