DynamicLink.Builder

public final class DynamicLink.Builder


Builder for creating Dynamic Links.

Summary

Public methods

@NonNull DynamicLink

Creates a Dynamic Link from the parameters.

@NonNull Task<ShortDynamicLink>

Creates a shortened Dynamic Link from the parameters.

@NonNull Task<ShortDynamicLink>

Creates a shortened Dynamic Link from the parameters.

@NonNull String
@NonNull Uri
@NonNull Uri
@NonNull DynamicLink.Builder

Sets the Android parameters.

@NonNull DynamicLink.Builder
setDomainUriPrefix(@NonNull String domainUriPrefix)

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

@NonNull DynamicLink.Builder
setDynamicLinkDomain(@NonNull String dynamicLinkDomain)

This method is deprecated.

Use setDomainUriPrefix instead

@NonNull DynamicLink.Builder

Sets the Google Analytics parameters.

@NonNull DynamicLink.Builder

Sets the iOS parameters.

@NonNull DynamicLink.Builder

Sets the iTunes Connect App Analytics parameters.

@NonNull DynamicLink.Builder

Set the deep link.

@NonNull DynamicLink.Builder
setLongLink(@NonNull Uri longLink)

Set the long Dynamic Link.

@NonNull DynamicLink.Builder

Sets the navigation info parameters.

@NonNull DynamicLink.Builder

Sets the social meta-tag parameters.

Extension functions

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

final void

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

Public methods

buildDynamicLink

public @NonNull DynamicLink buildDynamicLink()

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

public @NonNull Task<ShortDynamicLinkbuildShortDynamicLink()

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

public @NonNull Task<ShortDynamicLinkbuildShortDynamicLink(@ShortDynamicLink.Suffix int suffix)

Creates a shortened Dynamic Link from the parameters.

Parameters
@ShortDynamicLink.Suffix int suffix

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

public @NonNull String getDomainUriPrefix()
Returns
@NonNull String

the deep link set to this DynamicLink.

getLink

public @NonNull Uri getLink()
Returns
@NonNull Uri

the deep link associated with this DynamicLink.

getLongLink

public @NonNull Uri getLongLink()
Returns
@NonNull Uri

the long Dynamic link associated with this DynamicLink.

setAndroidParameters

public @NonNull DynamicLink.Builder setAndroidParameters(
    @NonNull DynamicLink.AndroidParameters androidParameters
)

Sets the Android parameters.

Parameters
@NonNull DynamicLink.AndroidParameters androidParameters

The AndroidParameters from build.

setDomainUriPrefix

public @NonNull DynamicLink.Builder setDomainUriPrefix(@NonNull String domainUriPrefix)

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

Parameters
@NonNull String domainUriPrefix

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

setDynamicLinkDomain

public @NonNull DynamicLink.Builder setDynamicLinkDomain(@NonNull String dynamicLinkDomain)

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
@NonNull String dynamicLinkDomain

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

setGoogleAnalyticsParameters

public @NonNull DynamicLink.Builder setGoogleAnalyticsParameters(
    @NonNull DynamicLink.GoogleAnalyticsParameters googleAnalyticsParameters
)

Sets the Google Analytics parameters.

Parameters
@NonNull DynamicLink.GoogleAnalyticsParameters googleAnalyticsParameters

The GoogleAnalyticsParameters from build.

setIosParameters

public @NonNull DynamicLink.Builder setIosParameters(@NonNull DynamicLink.IosParameters iosParameters)

Sets the iOS parameters.

Parameters
@NonNull DynamicLink.IosParameters iosParameters

The IosParameters from build.

setItunesConnectAnalyticsParameters

public @NonNull DynamicLink.Builder setItunesConnectAnalyticsParameters(
    @NonNull DynamicLink.ItunesConnectAnalyticsParameters itunesConnectAnalyticsParameters
)

Sets the iTunes Connect App Analytics parameters.

Parameters
@NonNull DynamicLink.ItunesConnectAnalyticsParameters itunesConnectAnalyticsParameters

The ItunesConnectAnalyticsParameters from build.

setLink

public @NonNull DynamicLink.Builder setLink(@NonNull Uri link)

Set the deep link.

Parameters
@NonNull Uri 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.

setLongLink

public @NonNull DynamicLink.Builder setLongLink(@NonNull Uri longLink)

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

Parameters
@NonNull Uri longLink

The long FDL to shorten.

setNavigationInfoParameters

public @NonNull DynamicLink.Builder setNavigationInfoParameters(
    @NonNull DynamicLink.NavigationInfoParameters navigationInfoParameters
)

Sets the navigation info parameters.

Parameters
@NonNull DynamicLink.NavigationInfoParameters navigationInfoParameters

The NavigationInfoParameters from build.

setSocialMetaTagParameters

public @NonNull DynamicLink.Builder setSocialMetaTagParameters(
    @NonNull DynamicLink.SocialMetaTagParameters socialMetaTagParameters
)

Sets the social meta-tag parameters.

Parameters
@NonNull DynamicLink.SocialMetaTagParameters socialMetaTagParameters

The SocialMetaTagParameters from build.

Extension functions

FirebaseDynamicLinksKt.androidParameters

public final void FirebaseDynamicLinksKt.androidParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.AndroidParameters.BuilderUnit> init
)

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

FirebaseDynamicLinksKt.androidParameters

public final void FirebaseDynamicLinksKt.androidParameters(
    @NonNull DynamicLink.Builder receiver,
    @NonNull String packageName,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.AndroidParameters.BuilderUnit> init
)

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

FirebaseDynamicLinksKt.androidParameters

public final void FirebaseDynamicLinksKt.androidParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.AndroidParameters.BuilderUnit> init
)

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.

FirebaseDynamicLinksKt.androidParameters

public final void FirebaseDynamicLinksKt.androidParameters(
    @NonNull DynamicLink.Builder receiver,
    @NonNull String packageName,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.AndroidParameters.BuilderUnit> init
)

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.

FirebaseDynamicLinksKt.googleAnalyticsParameters

public final void FirebaseDynamicLinksKt.googleAnalyticsParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.GoogleAnalyticsParameters.BuilderUnit> init
)

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

FirebaseDynamicLinksKt.googleAnalyticsParameters

public final void FirebaseDynamicLinksKt.googleAnalyticsParameters(
    @NonNull DynamicLink.Builder receiver,
    @NonNull String source,
    @NonNull String medium,
    @NonNull String campaign,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.GoogleAnalyticsParameters.BuilderUnit> init
)

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

FirebaseDynamicLinksKt.googleAnalyticsParameters

public final void FirebaseDynamicLinksKt.googleAnalyticsParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.GoogleAnalyticsParameters.BuilderUnit> init
)

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.

FirebaseDynamicLinksKt.googleAnalyticsParameters

public final void FirebaseDynamicLinksKt.googleAnalyticsParameters(
    @NonNull DynamicLink.Builder receiver,
    @NonNull String source,
    @NonNull String medium,
    @NonNull String campaign,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.GoogleAnalyticsParameters.BuilderUnit> init
)

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.

FirebaseDynamicLinksKt.iosParameters

public final void FirebaseDynamicLinksKt.iosParameters(
    @NonNull DynamicLink.Builder receiver,
    @NonNull String bundleId,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.IosParameters.BuilderUnit> init
)

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

FirebaseDynamicLinksKt.iosParameters

public final void FirebaseDynamicLinksKt.iosParameters(
    @NonNull DynamicLink.Builder receiver,
    @NonNull String bundleId,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.IosParameters.BuilderUnit> init
)

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.

FirebaseDynamicLinksKt.itunesConnectAnalyticsParameters

public final void FirebaseDynamicLinksKt.itunesConnectAnalyticsParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.ItunesConnectAnalyticsParameters.BuilderUnit> init
)

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

FirebaseDynamicLinksKt.itunesConnectAnalyticsParameters

public final void FirebaseDynamicLinksKt.itunesConnectAnalyticsParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.ItunesConnectAnalyticsParameters.BuilderUnit> init
)

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.

FirebaseDynamicLinksKt.navigationInfoParameters

public final void FirebaseDynamicLinksKt.navigationInfoParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.NavigationInfoParameters.BuilderUnit> init
)

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

FirebaseDynamicLinksKt.navigationInfoParameters

public final void FirebaseDynamicLinksKt.navigationInfoParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.NavigationInfoParameters.BuilderUnit> init
)

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.

FirebaseDynamicLinksKt.socialMetaTagParameters

public final void FirebaseDynamicLinksKt.socialMetaTagParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.SocialMetaTagParameters.BuilderUnit> init
)

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

FirebaseDynamicLinksKt.socialMetaTagParameters

public final void FirebaseDynamicLinksKt.socialMetaTagParameters(
    @NonNull DynamicLink.Builder receiver,
    @ExtensionFunctionType @NonNull Function1<@NonNull DynamicLink.SocialMetaTagParameters.BuilderUnit> init
)

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.