这是发送方。
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);
}
这是接收端:
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]
}
我有以下查询:
- 接收端的invitationId有什么用?这可以用于任何目的吗?
- 我正在为 AdditionalReferralParameters 发送地图,如何在接收端访问这些值?
请帮助我。