FirebaseDynamicLinks Framework Reference

FIRDynamicLinkComponents


@interface FIRDynamicLinkComponents : 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

    Objective-C

    @property (nonatomic, nullable) FIRDynamicLinkGoogleAnalyticsParameters *analyticsParameters;
  • Applies Social Meta Tag parameters to a generated Dynamic Link URL.

    Declaration

    Objective-C

    @property (nonatomic, nullable) FIRDynamicLinkSocialMetaTagParameters *socialMetaTagParameters;
  • Applies iOS parameters to a generated Dynamic Link URL.

    Declaration

    Objective-C

    @property (nonatomic, nullable) FIRDynamicLinkIOSParameters *iOSParameters;
  • Applies iTunes Connect parameters to a generated Dynamic Link URL.

    Declaration

    Objective-C

    @property (nonatomic, nullable) FIRDynamicLinkItunesConnectAnalyticsParameters *iTunesConnectParameters;
  • Applies Android parameters to a generated Dynamic Link URL.

    Declaration

    Objective-C

    @property (nonatomic, nullable) FIRDynamicLinkAndroidParameters *androidParameters;
  • Applies Navigation Info parameters to a generated Dynamic Link URL.

    Declaration

    Objective-C

    @property (nonatomic, nullable) FIRDynamicLinkNavigationInfoParameters *navigationInfoParameters;
  • Applies Other platform parameters to a generated Dynamic Link URL.

    Declaration

    Objective-C

    @property (nonatomic, nullable) FIRDynamicLinkOtherPlatformParameters *otherPlatformParameters;
  • Defines behavior for generating Dynamic Link URLs.

    Declaration

    Objective-C

    @property (nonatomic, nullable) FIRDynamicLinkComponentsOptions *options;
  • 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

    Objective-C

    @property (nonatomic) NSURL *_Nonnull link;
  • 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

    Objective-C

    @property (nonatomic, copy, nullable) NSString *domain;
  • url

    A generated long Dynamic Link URL.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSURL *url;
  • Generates a Dynamic Link URL components object with the minimum necessary parameters set to generate a fully-functional Dynamic Link.

    Declaration

    Objective-C

    + (nullable instancetype)componentsWithLink:(nonnull NSURL *)link
                                domainURIPrefix:(nonnull NSString *)domainURIPrefix;

    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

    Objective-C

    - (nullable instancetype)initWithLink:(nonnull NSURL *)link
                          domainURIPrefix:(nonnull NSString *)domainURIPrefix;

    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

    Objective-C

    + (void)shortenURL:(nonnull NSURL *)url
               options:(FIRDynamicLinkComponentsOptions *_Nullable)options
            completion:(nonnull void (^)(NSURL *_Nullable,
                                         NSArray<NSString *> *_Nullable,
                                         NSError *_Nullable))completion;

    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

    Objective-C

    - (void)shortenWithCompletion:(nonnull void (^)(NSURL *_Nullable,
                                                    NSArray<NSString *> *_Nullable,
                                                    NSError *_Nullable))completion;

    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.