DynamicLink.Builder

public static final class DynamicLink.Builder extends Object

Builder for creating Dynamic Links.

Public Method Summary

DynamicLink
buildDynamicLink()
Creates a Dynamic Link from the parameters.
Task<ShortDynamicLink>
buildShortDynamicLink()
Creates a shortened Dynamic Link from the parameters.
Task<ShortDynamicLink>
buildShortDynamicLink(int suffix)
Creates a shortened Dynamic Link from the parameters.
DynamicLink.Builder
setAndroidParameters(DynamicLink.AndroidParameters androidParameters)
Sets the Android parameters.
DynamicLink.Builder
setDynamicLinkDomain(String dynamicLinkDomain)
Sets the domain (of the form "xyz.app.goo.gl") to use for this Dynamic Link.
DynamicLink.Builder
setGoogleAnalyticsParameters(DynamicLink.GoogleAnalyticsParameters googleAnalyticsParameters)
Sets the Google Analytics parameters.
DynamicLink.Builder
setIosParameters(DynamicLink.IosParameters iosParameters)
Sets the iOS parameters.
DynamicLink.Builder
setItunesConnectAnalyticsParameters(DynamicLink.ItunesConnectAnalyticsParameters itunesConnectAnalyticsParameters)
Sets the iTunes Connect App Analytics parameters.
DynamicLink.Builder
setLink(Uri link)
Set the deep link.
DynamicLink.Builder
setLongLink(Uri longLink)
Set the long Dynamic Link.
DynamicLink.Builder
setNavigationInfoParameters(DynamicLink.NavigationInfoParameters navigationInfoParameters)
Sets the navigation info parameters.
DynamicLink.Builder
setSocialMetaTagParameters(DynamicLink.SocialMetaTagParameters socialMetaTagParameters)
Sets the social meta-tag parameters.

Inherited Method Summary

Public Methods

public DynamicLink buildDynamicLink ()

Creates a Dynamic Link from the parameters.

Throws
IllegalArgumentException if the FDL domain is not set. Set with setDynamicLinkDomain(String).

public Task<ShortDynamicLink> buildShortDynamicLink ()

Creates a shortened Dynamic Link from the parameters.

Throws
IllegalArgumentException if the FDL domain and api key are not set. Set FDL domain with setDynamicLinkDomain(String). Ensure that google-services.json file is setup for the app if the api key is not set.

public Task<ShortDynamicLink> buildShortDynamicLink (int suffix)

Creates a shortened Dynamic Link from the parameters.

Parameters
suffix The desired length of the Dynamic Link. One of UNGUESSABLE or SHORT.
Throws
IllegalArgumentException if the FDL domain and api key are not set. Set FDL domain with setDynamicLinkDomain(String). Ensure that google-services.json file is setup for the app if the api key is not set.

public DynamicLink.Builder setAndroidParameters (DynamicLink.AndroidParameters androidParameters)

Sets the Android parameters.

Parameters
androidParameters The AndroidParameters from build().

public DynamicLink.Builder setDynamicLinkDomain (String dynamicLinkDomain)

Sets the domain (of the form "xyz.app.goo.gl") to use for this Dynamic Link.

Parameters
dynamicLinkDomain The target project's Dynamic Links domain. You can find this value in the Dynamic Links section of the Firebase console.

public DynamicLink.Builder setGoogleAnalyticsParameters (DynamicLink.GoogleAnalyticsParameters googleAnalyticsParameters)

Sets the Google Analytics parameters.

Parameters
googleAnalyticsParameters The GoogleAnalyticsParameters from build().

public DynamicLink.Builder setIosParameters (DynamicLink.IosParameters iosParameters)

Sets the iOS parameters.

Parameters
iosParameters The IosParameters from build().

public DynamicLink.Builder setItunesConnectAnalyticsParameters (DynamicLink.ItunesConnectAnalyticsParameters itunesConnectAnalyticsParameters)

Sets the iTunes Connect App Analytics parameters.

Parameters
itunesConnectAnalyticsParameters The ItunesConnectAnalyticsParameters from build().

public DynamicLink.Builder setLink (Uri link)

Set the deep link.

Parameters
link The link your app will open. You can specify any URL your app can handle, such as a link to your app's content, or a URL that initiates some app-specific logic such as crediting the user with a coupon, or displaying a specific welcome screen. This link must be a well-formatted URL, be properly URL-encoded, and use the HTTP or HTTPS scheme.

public DynamicLink.Builder setLongLink (Uri longLink)

Set the long Dynamic Link. This can be used with buildShortDynamicLink() to shorten an existing long FDL into a short FDL.

Parameters
longLink The long FDL to shorten.

public DynamicLink.Builder setNavigationInfoParameters (DynamicLink.NavigationInfoParameters navigationInfoParameters)

Sets the navigation info parameters.

Parameters
navigationInfoParameters The NavigationInfoParameters from build().

public DynamicLink.Builder setSocialMetaTagParameters (DynamicLink.SocialMetaTagParameters socialMetaTagParameters)

Sets the social meta-tag parameters.

Parameters
socialMetaTagParameters The SocialMetaTagParameters from build().