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 finalCreator<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(Parceldest, int
flags)
|
Inherited Method Summary
Constants
public static final int RESULT_LAUNCH_OK
URL can be launched
public static final int RESULT_NO_LAUNCH
URL could not be launched for an unspecified reason
public static final int RESULT_NO_LAUNCH_HOLDBACK
URL could have been launched but was withheld due to a mobile holdback from dev console
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
Fields
public static finalCreator<InstantAppIntentData> CREATOR
Public Methods
publicIntent 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 theEXTRA_REFERRER
extra to the Intent, with theUri
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 intgetMatchResult()
Returns the result for the match attempt of the given URL.
publicStringgetPackageName()
Returns the package name of the instant app if one exists for the URL. Otherwise,
null
.