Provides accessor methods to dynamic links data.
Protected Constructor Summary
PendingDynamicLinkData(String deepLink,
int minVersion, long clickTimestamp, Uri redirectUrl)
Create a PendingDynamicLinkData which can be used for testing.
|
Public Method Summary
long |
getClickTimestamp()
The time that the user clicked on the dynamic link.
|
Uri |
getLink()
Return the link parameter of the dynamic link.
|
int |
getMinimumAppVersion()
The minimum app version requested to process the dynamic link that can be
compared directly with
versionCode .
|
Intent |
getUpdateAppIntent(Context
context)
Provide an intent to update the app to the version in the Play Store.
|
Inherited Method Summary
Protected Constructors
protected PendingDynamicLinkData (String deepLink, int minVersion, long clickTimestamp, Uri redirectUrl)
Create a PendingDynamicLinkData which can be used for testing.
Parameters
deepLink | dynamic link deep link, can be null. |
---|---|
minVersion | app minimum version. 0 if no minimum version required. |
clickTimestamp | timestamp of when the dynamic link was clicked. If zero, will be current time. |
redirectUrl |
Public Methods
public long getClickTimestamp ()
The time that the user clicked on the dynamic link. This can be used to determine the amount of time that has passed since the user selected the link until the app is launched.
Returns
- The number of milliseconds that have elapsed since January 1, 1970.
public Uri getLink ()
Return the link parameter of the dynamic link.
This link will be set as data in the launch Intent, see
setData(Uri)
, which will match IntentFilter
to deep link into the app.
Returns
- The deep link if it exists, null otherwise.
public int getMinimumAppVersion ()
The minimum app version requested to process the dynamic link that can be compared
directly with versionCode
.
If the minimum version code is higher than the installed app version code, the app can
upgrade using
getUpdateAppIntent(Context)
.
Returns
- minimum version code set on the dynamic link, or 0 if not specified.
public Intent getUpdateAppIntent (Context context)
Provide an intent to update the app to the version in the Play Store.
An intent is returned to be used as a parameter to
startActivity(Intent)
to launch the Play Store update flow for the app.
After update, if the user re-launches the app from the Play Store by selecting the
displayed Continue button then the deep link will be set as the data in the re-launch
intent and will launch any Activity with an IntentFilter
that matches the deeplink. This is the same as the new install flow. The dynamic link
returned during initial launch will not be available from
getDynamicLink(Intent)
during the update re-launch.
If the minimum version required by the dynamic link is not greater than the currently installed version, then null is returned.
Returns
- - An
Intent
that will launch the Play Store to update the app, or null if the dynamic link minimum version code is not greater than the installed version.