InstantAppIntentData | Doclava
public class

InstantAppIntentData

extends Object
implements Parcelable
java.lang.Object
   ↳ com.google.android.gms.instantapps.InstantAppIntentData

Class Overview

Data for resolved instant app Intent.

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

See also:

Summary

Nested Classes
@interface InstantAppIntentData.MatchResult Denotes an enumeration of possible results for match a URL to an instant app. 
Constants
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
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<InstantAppIntentData> CREATOR
Public Methods
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)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int RESULT_LAUNCH_OK

URL can be launched

Constant Value: 0 (0x00000000)

public static final int RESULT_NO_LAUNCH

URL could not be launched for an unspecified reason

Constant Value: 1 (0x00000001)

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 (0x00000002)

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 (0x00000003)

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
Intent 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.

Returns
int

public String getPackageName ()

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

Returns
String

public void writeToParcel (Parcel dest, int flags)

Parameters
dest Parcel
flags int