This class is deprecated.
Starting December 2025, Instant Apps cannot be published through Google Play, and all Google
Play services Instant APIs will no longer work. To continue optimizing for user growth, we
encourage developers to refer users to their regular app or game, and using deeplinks to
redirect them to specific journeys or features when relevant.
Data for launching an instant app.
Meant for use by apps that want to launch instant apps, e.g. web browsers.
Inherited Constant Summary
Field Summary
public static final Creator<LaunchData> | CREATOR |
Public Method Summary
Bitmap |
getApplicationIcon()
Returns the application icon for the instant app.
|
String |
getApplicationLabel()
Returns the label for the instant app.
|
Intent | |
String |
getPackageName()
Returns the package name of the instant app.
|
void |
writeToParcel(Parcel dest, int
flags)
|
Inherited Method Summary
Fields
public static final Creator<LaunchData> CREATOR
Public Methods
public Bitmap getApplicationIcon ()
Returns the application icon for the instant app.
Returns
- the application icon for the instant app if one exists for the URL. Otherwise,
null
.
public String getApplicationLabel ()
Returns the label for the instant app.
Returns
- the label for the instant app if one exists for the URL. Otherwise,
null
.
public Intent getIntent ()
Returns the Intent
to
launch the instant app.
The caller should add the Intent.EXTRA_REFERRER
extra to the returned instant app 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
Launcher.EXTRA_IS_REFERRER_TRUSTED
extra may be set true.
For clicks within the caller, the
Launcher.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.
Extras to be set in the returned intent, as appropriate, by the caller are
Intent.EXTRA_REFERRER
,
Launcher.EXTRA_TRUSTED_REFERRER_PKG
,
Launcher.EXTRA_IS_REFERRER_TRUSTED
,
Launcher.EXTRA_IS_USER_CONFIRMED_LAUNCH
, Browser.EXTRA_APPLICATION_ID
,
android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES
,
android.nfc.NfcAdapter#EXTRA_TAG
, and
android.nfc.NfcAdapter#EXTRA_ID
.
Returns
- the
Intent
to launch the instant app if one exists for the URL. Otherwise,null
.
public String getPackageName ()
Returns the package name of the instant app.
Returns
- the package name of the instant app if one exists for the URL. Otherwise,
null
.