Go to console

AppInviteInvitation.IntentBuilder

public static final class AppInviteInvitation.IntentBuilder extends Object

Build an Intent to launch the invitation Activity to create and send invitations.

The Intent returned from build() should be used to start the Activity using startActivityForResult(android.content.Intent, int).

Example:

Intent intent = new AppInviteInvitation
     .IntentBuilder("Send Invitations for XYZ app")
     // Ensure valid length for any message used before calling otherwise this will throw
     // an IllegalArgumentException if greater than MAX_MESSAGE_LENGTH.
     .setMessage("Try out XYZ app now")
     .setDeepLink(Uri.parse("//xyz.com/offer/free_trial_campaign"))
     .setCallToActionText("Find data")
     ...
     .build();
 startActivityForResult(intent, REQUEST_INVITE);

 

AppInviteReferral provides accessors to the broadcast parameters from within a custom broadcast receiver.

Nested Class Summary

@interface AppInviteInvitation.IntentBuilder.PlatformMode Mode for checking platform types. 

Constant Summary

int MAX_CALL_TO_ACTION_TEXT_LENGTH Maximum length for the invitation button text set in setCallToActionText(CharSequence).
int MAX_EMAIL_HTML_CONTENT Maximum size for the email html content in bytes for setEmailHtmlContent(String).
int MAX_MESSAGE_LENGTH Maximum length for the invitation message set in setMessage(CharSequence).
int MIN_CALL_TO_ACTION_TEXT_LENGTH Minimum length for the invitation button text set in setCallToActionText(CharSequence).

Public Constructor Summary

AppInviteInvitation.IntentBuilder(CharSequence title)
App invite invitation builder.

Public Method Summary

Intent
build()
Builds the Intent to start the invitation Activity.
AppInviteInvitation.IntentBuilder
setAccount(Account account)
Sets the name of the account to get a list of people for.
AppInviteInvitation.IntentBuilder
setAdditionalReferralParameters(Map<StringString> params)
Adds query parameters to the play store referral URL when the app needs additional referral parameters for other application component referrals.
AppInviteInvitation.IntentBuilder
setAndroidMinimumVersionCode(int versionCode)
Sets the minimum version of the android app installed on the receiving device.
AppInviteInvitation.IntentBuilder
setCallToActionText(CharSequence callToActionText)
Text shown on the email invitation for the user to accept the invitation.
AppInviteInvitation.IntentBuilder
setCustomImage(Uri imageUri)
Sets an image for invitations.
AppInviteInvitation.IntentBuilder
setDeepLink(Uri deepLink)
Sets the deep link that is made available to the app when opened from the invitation.
AppInviteInvitation.IntentBuilder
setEmailHtmlContent(String htmlContent)
Sets the HTML-formatted (UTF-8 encoded, no JavaScript) content for invites sent through email.
AppInviteInvitation.IntentBuilder
setEmailSubject(String subject)
Sets the subject for invites sent by email.
AppInviteInvitation.IntentBuilder
setGoogleAnalyticsTrackingId(String trackingId)
Sets the Google Analytics Tracking id.
AppInviteInvitation.IntentBuilder
setMessage(CharSequence message)
Sets the invite message that is sent to all invitees.
AppInviteInvitation.IntentBuilder
setOtherPlatformsTargetApplication(int targetPlatform, String clientId)
Targets another version of your app to receive the invitation from Android.

Inherited Method Summary

Constants

public static final int MAX_CALL_TO_ACTION_TEXT_LENGTH

Maximum length for the invitation button text set in setCallToActionText(CharSequence).

Constant Value: 20

public static final int MAX_EMAIL_HTML_CONTENT

Maximum size for the email html content in bytes for setEmailHtmlContent(String).

Constant Value: 512000

public static final int MAX_MESSAGE_LENGTH

Maximum length for the invitation message set in setMessage(CharSequence).

Constant Value: 100

public static final int MIN_CALL_TO_ACTION_TEXT_LENGTH

Minimum length for the invitation button text set in setCallToActionText(CharSequence).

Constant Value: 2

Public Constructors

public AppInviteInvitation.IntentBuilder (CharSequence title)

App invite invitation builder.

Parameters
title Sets the title for the invitation Activity.
Returns
  • Self-reference for method chaining.
Throws
NullPointerException if title is null.

Public Methods

public Intent build ()

Builds the Intent to start the invitation Activity.

Returns

public AppInviteInvitation.IntentBuilder setAccount (Account account)