java.lang.Object | |
↳ | com.google.android.gms.appinvite.AppInviteReferral |
Provides accessors to the referral data consisting of an invitation id and possibly a deep link
if set using
setDeepLink(Uri)
.
The referral data is made available to the application when it is opened after a user accepts an
invitation created with AppInviteInvitation
.
When the user accepts an invitation and the application is not already installed, the user
will enter a flow to install and open the application.
After install the AppInvite referral data will be available and
can be accessed using getInvitation(GoogleApiClient, android.app.Activity, boolean)
.
If the app is already installed, the referral data is included in the intent returned from getIntent(). The deep link will launch the app into a specified activity if filters have been setup to trigger on the deeplink, see Enabling Deep Links for App Content.
In both cases, the referral data is made available to the application.
To check if the referral data is present use hasReferral(Intent)
and if true, then access the data using getInvitationId(android.content.Intent)
and getDeepLink(android.content.Intent)
from the intent returned from
getInvitationIntent()
.
If the deep link was not set when creating
the invitation, the invitationIntent will not include a deep link and the app will be start
in its main activity.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
Use
getInvitation(GoogleApiClient, android.app.Activity, boolean)
to access AppInvite referrer data rather than implementing a Play Store broadcast receiver.
| |||||||||||
This method is deprecated.
Use
getInvitation(GoogleApiClient, android.app.Activity, boolean)
to access AppInvite referrer data rather than implementing a Play Store broadcast receiver.
| |||||||||||
Returns an deep link from an invitation if the deep link was set when the invitation
was created.
| |||||||||||
Get the invitation id from the referralIntent.
| |||||||||||
Determine if the referralIntent includes referral data.
| |||||||||||
Determine if the app was opened after installation from the play store.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
This method is deprecated.
Use getInvitation(GoogleApiClient, android.app.Activity, boolean)
to access AppInvite referrer data rather than implementing a Play Store broadcast receiver.
Extract the referrer data from the playStoreReferrerIntent as sent from the play store
and add it to an intent that can then be sent to an application activity.
The referrer broadcast is sent immediately after the application is opened after
being installed from the play store. To access the broadcast intent, the application
must implement a
InstallReferrerReceiver broadcast receiver, the
intent received is the playStoreReferrerIntent.
The referrer data is extracted from the playStoreReferrerIntent and added to the
referralIntent where it can then be retrieved from the referralIntent using
getInvitationId(android.content.Intent)
and
getDeepLink(android.content.Intent)
.
playStoreReferrerIntent | The intent send with the play store broadcast. |
---|---|
referralIntent | An Intent that the the playStoreReferrerIntent referral data will be added to. If null, the referral data will not be added. |
This method is deprecated.
Use getInvitation(GoogleApiClient, android.app.Activity, boolean)
to access AppInvite referrer data rather than implementing a Play Store broadcast receiver.
Create a referral bundle from invitation id and deeplink, attach to the intent as an extra.
invitationId | Invitation id. |
---|---|
deepLink | Deep link string. |
referralIntent | Intent to add the bundle to. |
Returns an deep link from an invitation if the deep link was set when the invitation was created.
referralIntent | Intent returned from
getInvitationIntent() after Play Store install
or getIntent() for an existing installed app. |
---|
Get the invitation id from the referralIntent.
referralIntent | Intent returned from
getInvitationIntent() after Play Store install
or getIntent() for an existing installed app. |
---|
hasReferral(Intent)
is true.
Determine if the referralIntent includes referral data.
referralIntent | Intent returned from
getInvitationIntent() after Play Store install
or getIntent() for an existing installed app. |
---|
Determine if the app was opened after installation from the play store.
referralIntent | Intent returned from
getInvitationIntent() after Play Store install
or getIntent() for an existing installed app. |
---|