InstantAppIntentData

public class InstantAppIntentData extends Object
implements Parcelable

Data for resolved instant app Intent.

Meant for use by apps that want to launch instant apps, e.g. web browsers.

Nested Class Summary

@interface InstantAppIntentData.MatchResult Denotes an enumeration of possible results for match a URL to an instant app. 

Constant Summary

int RESULT_LAUNCH_OK URL can be launched
int RESULT_NO_LAUNCH URL could not be launched for an unspecified reason
int RESULT_NO_LAUNCH_HOLDBACK URL could have been launched but was withheld due to a mobile holdback from dev console
int RESULT_USER_PREFERS_BROWSER URL can be launched but the user prefers to use the browser so further consent is necessary

Inherited Constant Summary

Field Summary

public static final Creator<InstantAppIntentData> CREATOR

Public Method Summary

Intent
getIntent()
Retrieve the Activity Intent used to start the instant app.
int
getMatchResult()
Returns the result for the match attempt of the given URL.
String
getPackageName()
Returns the package name of the instant app if one exists for the URL.
void
writeToParcel(Parcel dest, int flags)

Inherited Method Summary

Constants

public static final int RESULT_LAUNCH_OK

URL can be launched

Constant Value: 0

public static final int RESULT_NO_LAUNCH

URL could not be launched for an unspecified reason

Constant Value: 1

public static final int RESULT_NO_LAUNCH_HOLDBACK

URL could have been launched but was withheld due to a mobile holdback from dev console

Constant Value: 2

public static final int RESULT_USER_PREFERS_BROWSER

URL can be launched but the user prefers to use the browser so further consent is necessary

Constant Value: 3

Fields

public static final Creator<InstantAppIntentData> CREATOR

Public Methods

public Intent getIntent ()

Retrieve the Activity Intent used to start the instant app. Returns null if an instant app does not exist for the URL or if instant apps are disabled. A non-null return value does not guarantee existence of an instant app for the URL.

The caller should add the EXTRA_REFERRER extra to the Intent, with the Uri of the referrer web page, if available, respecting its referrer policy. If the referrer value originates within or is validated by the caller then EXTRA_IS_REFERRER_TRUSTED extra may be set true.

For clicks within the caller, the EXTRA_TRUSTED_REFERRER_PKG should be set to the package name of the caller. In other cases, this extra should be set only if the caller can validate the package name of the originator of the launch.

Returns
  • the Intent to attempt the start of an instant app or null if an instant app can't be run for this URL.

public int getMatchResult ()

Returns the result for the match attempt of the given URL.

public String getPackageName ()

Returns the package name of the instant app if one exists for the URL. Otherwise, null.

public void writeToParcel (Parcel dest, int flags)