DynamicLinkComponents
class DynamicLinkComponents : NSObject
The class used for Dynamic Link URL generation; supports creation of short and long Dynamic Link URLs. Short URLs will have a domain and a randomized path; long URLs will have a domain and a query that contains all of the Dynamic Link parameters.
-
Applies Analytics parameters to a generated Dynamic Link URL.
Declaration
Swift
var analyticsParameters: DynamicLinkGoogleAnalyticsParameters? { get set }
-
Applies Social Meta Tag parameters to a generated Dynamic Link URL.
Declaration
Swift
var socialMetaTagParameters: DynamicLinkSocialMetaTagParameters? { get set }
-
Applies iOS parameters to a generated Dynamic Link URL.
Declaration
Swift
var iOSParameters: DynamicLinkIOSParameters? { get set }
-
Applies iTunes Connect parameters to a generated Dynamic Link URL.
Declaration
Swift
var iTunesConnectParameters: DynamicLinkItunesConnectAnalyticsParameters? { get set }
-
Applies Android parameters to a generated Dynamic Link URL.
Declaration
Swift
var androidParameters: DynamicLinkAndroidParameters? { get set }
-
Applies Navigation Info parameters to a generated Dynamic Link URL.
Declaration
Swift
var navigationInfoParameters: DynamicLinkNavigationInfoParameters? { get set }
-
Applies Other platform parameters to a generated Dynamic Link URL.
Declaration
Swift
var otherPlatformParameters: DynamicLinkOtherPlatformParameters? { get set }
-
Defines behavior for generating Dynamic Link URLs.
Declaration
Swift
var options: DynamicLinkComponentsOptions? { get set }
-
The link the target app will open. You can specify any URL the app can handle, such as a link to the 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.
Declaration
Swift
var link: URL { get set }
-
The Firebase project’s Dynamic Links domain. You can find this value in the Dynamic Links section of the Firebase console. https://console.firebase.google.com/
Declaration
Swift
var domain: String? { get set }
-
A generated long Dynamic Link URL.
Declaration
Swift
var url: URL? { get }
-
Generates a Dynamic Link URL components object with the minimum necessary parameters set to generate a fully-functional Dynamic Link.
Parameters
link
Deep link to be stored in created Dynamic link. This link also called “payload” of the Dynamic link.
domainURIPrefix
Domain URI Prefix of your App. This value must be your assigned domain from the Firebase console. (e.g. https://xyz.page.link) The domain URI prefix must start with a valid HTTPS scheme (https://).
Return Value
Returns an instance of FIRDynamicLinkComponents if the parameters succeed validation, else returns nil.
-
Generates a Dynamic Link URL components object with the minimum necessary parameters set to generate a fully-functional Dynamic Link.
Declaration
Swift
init?(link: URL, domainURIPrefix: String)
Parameters
link
Deep link to be stored in created Dynamic link. This link also called “payload” of the Dynamic link.
domainURIPrefix
Domain URI Prefix of your App. This value must be your assigned domain from the Firebase console. (e.g. https://xyz.page.link) The domain URI prefix must start with a valid HTTPS scheme (https://).
Return Value
Returns an instance of FIRDynamicLinkComponents if the parameters succeed validation, else returns nil.
-
Shortens a Dynamic Link URL. This method may be used for shortening a custom URL that was not generated using FIRDynamicLinkComponents.
Declaration
Swift
class func shortenURL(_ url: URL, options: DynamicLinkComponentsOptions?) async throws -> (URL, [String])
Parameters
url
A properly-formatted long Dynamic Link URL.
completion
A block to be executed upon completion of the shortening attempt. It is guaranteed to be executed once and on the main thread.
-
Generates a short Dynamic Link URL using all set parameters.
Declaration
Swift
func shorten() async throws -> (URL, [String])
Parameters
completion
A block to be executed upon completion of the shortening attempt. It is guaranteed to be executed once and on the main thread.