DynamicLink.Builder

class DynamicLink.Builder


Builder for creating Dynamic Links.

Summary

Public functions

DynamicLink

Creates a Dynamic Link from the parameters.

Task<ShortDynamicLink!>

Creates a shortened Dynamic Link from the parameters.

Task<ShortDynamicLink!>

Creates a shortened Dynamic Link from the parameters.

String
Uri
Uri
DynamicLink.Builder

Sets the Android parameters.

DynamicLink.Builder
setDomainUriPrefix(domainUriPrefix: String)

Sets the domain uri prefix (of the form "https://xyz.app.goo.gl", "https://custom.com/xyz") to use for this Dynamic Link.

DynamicLink.Builder
setDynamicLinkDomain(dynamicLinkDomain: String)

This function is deprecated.

Use setDomainUriPrefix instead

DynamicLink.Builder

Sets the Google Analytics parameters.

DynamicLink.Builder

Sets the iOS parameters.

DynamicLink.Builder

Sets the iTunes Connect App Analytics parameters.

DynamicLink.Builder
setLink(link: Uri)

Set the deep link.

DynamicLink.Builder
setLongLink(longLink: Uri)

Set the long Dynamic Link.

DynamicLink.Builder

Sets the navigation info parameters.

DynamicLink.Builder

Sets the social meta-tag parameters.

Extension functions

Unit

Creates a DynamicLink.AndroidParameters object initialized using the init function and sets it to the DynamicLink.Builder

Unit

Creates a DynamicLink.AndroidParameters object initialized with the specified packageName and using the init function and sets it to the DynamicLink.Builder

Unit

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Unit

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Unit

Creates a DynamicLink.GoogleAnalyticsParameters object initialized using the init function and sets it to the DynamicLink.Builder

Unit
DynamicLink.Builder.googleAnalyticsParameters(
    source: String,
    medium: String,
    campaign: String,
    init: DynamicLink.GoogleAnalyticsParameters.Builder.() -> Unit
)

Creates a DynamicLink.GoogleAnalyticsParameters object initialized with the specified source, medium, campaign and using the init function and sets it to the DynamicLink.Builder.

Unit

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Unit
DynamicLink.Builder.googleAnalyticsParameters(
    source: String,
    medium: String,
    campaign: String,
    init: DynamicLink.GoogleAnalyticsParameters.Builder.() -> Unit
)

This function is deprecated. com.google.firebase.dynam

Unit

Creates a DynamicLink.IosParameters object initialized with the specified bundleId and using the init function and sets it to the DynamicLink.Builder

Unit

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Unit

Creates a DynamicLink.ItunesConnectAnalyticsParameters object initialized using the init function and sets it to the DynamicLink.Builder

Unit

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Unit

Creates a DynamicLink.NavigationInfoParameters object initialized using the init function and sets it to the DynamicLink.Builder

Unit

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Unit

Creates a DynamicLink.SocialMetaTagParameters object initialized using the init function and sets it to the DynamicLink.Builder

Unit

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Public functions

buildDynamicLink

fun buildDynamicLink(): DynamicLink

Creates a Dynamic Link from the parameters.

Throws
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException

if the FDL domain is not set. Set with setDynamicLinkDomain.

buildShortDynamicLink

fun buildShortDynamicLink(): Task<ShortDynamicLink!>

Creates a shortened Dynamic Link from the parameters.

Throws
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException

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

buildShortDynamicLink

fun buildShortDynamicLink(@ShortDynamicLink.Suffix suffix: Int): Task<ShortDynamicLink!>

Creates a shortened Dynamic Link from the parameters.

Parameters
@ShortDynamicLink.Suffix suffix: Int

The desired length of the Dynamic Link. One of UNGUESSABLE or SHORT.

Throws
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException

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

getDomainUriPrefix

fun getDomainUriPrefix(): String
Returns
String

the deep link set to this DynamicLink.

getLink

fun getLink(): Uri
Returns
Uri

the deep link associated with this DynamicLink.

getLongLink

fun getLongLink(): Uri
Returns
Uri

the long Dynamic link associated with this DynamicLink.

setAndroidParameters

fun setAndroidParameters(androidParameters: DynamicLink.AndroidParameters): DynamicLink.Builder

Sets the Android parameters.

Parameters
androidParameters: DynamicLink.AndroidParameters

The AndroidParameters from build.

setDomainUriPrefix

fun setDomainUriPrefix(domainUriPrefix: String): DynamicLink.Builder

Sets the domain uri prefix (of the form "https://xyz.app.goo.gl", "https://custom.com/xyz") to use for this Dynamic Link.

Parameters
domainUriPrefix: String

The target project's Domain Uri Prefix. You can find this value in the Dynamic Links section of the Firebase console.

setDynamicLinkDomain

fun setDynamicLinkDomain(dynamicLinkDomain: String): DynamicLink.Builder

Sets the domain (of the form "xyz.app.goo.gl") to use for this Dynamic Link. Only applicable for *.page.link and *.app.goo.gl, use setDomainUriPrefix if domain is custom.

Parameters
dynamicLinkDomain: String

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

setGoogleAnalyticsParameters

fun setGoogleAnalyticsParameters(
    googleAnalyticsParameters: DynamicLink.GoogleAnalyticsParameters
): DynamicLink.Builder

Sets the Google Analytics parameters.

Parameters
googleAnalyticsParameters: DynamicLink.GoogleAnalyticsParameters

The GoogleAnalyticsParameters from build.

setIosParameters

fun setIosParameters(iosParameters: DynamicLink.IosParameters): DynamicLink.Builder

Sets the iOS parameters.

Parameters
iosParameters: DynamicLink.IosParameters

The IosParameters from build.

setItunesConnectAnalyticsParameters

fun setItunesConnectAnalyticsParameters(
    itunesConnectAnalyticsParameters: DynamicLink.ItunesConnectAnalyticsParameters
): DynamicLink.Builder

Sets the iTunes Connect App Analytics parameters.

Parameters
itunesConnectAnalyticsParameters: DynamicLink.ItunesConnectAnalyticsParameters

The ItunesConnectAnalyticsParameters from build.

setLink

fun setLink(link: Uri): DynamicLink.Builder

Set the deep link.

Parameters
link: Uri

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.

setLongLink

fun setLongLink(longLink: Uri): DynamicLink.Builder

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

Parameters
longLink: Uri

The long FDL to shorten.

setNavigationInfoParameters

fun setNavigationInfoParameters(
    navigationInfoParameters: DynamicLink.NavigationInfoParameters
): DynamicLink.Builder

Sets the navigation info parameters.

Parameters
navigationInfoParameters: DynamicLink.NavigationInfoParameters

The NavigationInfoParameters from build.

setSocialMetaTagParameters

fun setSocialMetaTagParameters(
    socialMetaTagParameters: DynamicLink.SocialMetaTagParameters
): DynamicLink.Builder

Sets the social meta-tag parameters.

Parameters
socialMetaTagParameters: DynamicLink.SocialMetaTagParameters

The SocialMetaTagParameters from build.

Extension functions

androidParameters

fun DynamicLink.Builder.androidParameters(init: DynamicLink.AndroidParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.AndroidParameters object initialized using the init function and sets it to the DynamicLink.Builder

androidParameters

fun DynamicLink.Builder.androidParameters(
    packageName: String,
    init: DynamicLink.AndroidParameters.Builder.() -> Unit
): Unit

Creates a DynamicLink.AndroidParameters object initialized with the specified packageName and using the init function and sets it to the DynamicLink.Builder

androidParameters

fun DynamicLink.Builder.androidParameters(init: DynamicLink.AndroidParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.AndroidParameters object initialized using the init function and sets it to the DynamicLink.Builder

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-dynamic-links-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

androidParameters

fun DynamicLink.Builder.androidParameters(
    packageName: String,
    init: DynamicLink.AndroidParameters.Builder.() -> Unit
): Unit

Creates a DynamicLink.AndroidParameters object initialized with the specified packageName and using the init function and sets it to the DynamicLink.Builder

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-dynamic-links-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

googleAnalyticsParameters

fun DynamicLink.Builder.googleAnalyticsParameters(init: DynamicLink.GoogleAnalyticsParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.GoogleAnalyticsParameters object initialized using the init function and sets it to the DynamicLink.Builder

googleAnalyticsParameters

fun DynamicLink.Builder.googleAnalyticsParameters(
    source: String,
    medium: String,
    campaign: String,
    init: DynamicLink.GoogleAnalyticsParameters.Builder.() -> Unit
): Unit

Creates a DynamicLink.GoogleAnalyticsParameters object initialized with the specified source, medium, campaign and using the init function and sets it to the DynamicLink.Builder.

googleAnalyticsParameters

fun DynamicLink.Builder.googleAnalyticsParameters(init: DynamicLink.GoogleAnalyticsParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.GoogleAnalyticsParameters object initialized using the init function and sets it to the DynamicLink.Builder

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-dynamic-links-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

googleAnalyticsParameters

fun DynamicLink.Builder.googleAnalyticsParameters(
    source: String,
    medium: String,
    campaign: String,
    init: DynamicLink.GoogleAnalyticsParameters.Builder.() -> Unit
): Unit

Creates a DynamicLink.GoogleAnalyticsParameters object initialized with the specified source, medium, campaign and using the init function and sets it to the DynamicLink.Builder.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-dynamic-links-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

iosParameters

fun DynamicLink.Builder.iosParameters(bundleId: String, init: DynamicLink.IosParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.IosParameters object initialized with the specified bundleId and using the init function and sets it to the DynamicLink.Builder

iosParameters

fun DynamicLink.Builder.iosParameters(bundleId: String, init: DynamicLink.IosParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.IosParameters object initialized with the specified bundleId and using the init function and sets it to the DynamicLink.Builder

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-dynamic-links-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

itunesConnectAnalyticsParameters

fun DynamicLink.Builder.itunesConnectAnalyticsParameters(init: DynamicLink.ItunesConnectAnalyticsParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.ItunesConnectAnalyticsParameters object initialized using the init function and sets it to the DynamicLink.Builder

itunesConnectAnalyticsParameters

fun DynamicLink.Builder.itunesConnectAnalyticsParameters(init: DynamicLink.ItunesConnectAnalyticsParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.ItunesConnectAnalyticsParameters object initialized using the init function and sets it to the DynamicLink.Builder

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-dynamic-links-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

navigationInfoParameters

fun DynamicLink.Builder.navigationInfoParameters(init: DynamicLink.NavigationInfoParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.NavigationInfoParameters object initialized using the init function and sets it to the DynamicLink.Builder

navigationInfoParameters

fun DynamicLink.Builder.navigationInfoParameters(init: DynamicLink.NavigationInfoParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.NavigationInfoParameters object initialized using the init function and sets it to the DynamicLink.Builder

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-dynamic-links-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

socialMetaTagParameters

fun DynamicLink.Builder.socialMetaTagParameters(init: DynamicLink.SocialMetaTagParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.SocialMetaTagParameters object initialized using the init function and sets it to the DynamicLink.Builder

socialMetaTagParameters

fun DynamicLink.Builder.socialMetaTagParameters(init: DynamicLink.SocialMetaTagParameters.Builder.() -> Unit): Unit

Creates a DynamicLink.SocialMetaTagParameters object initialized using the init function and sets it to the DynamicLink.Builder

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-dynamic-links-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.