Skip to content

Dynamic Links Create Dynamic Links

Eoin Landy edited this page Jan 30, 2020 · 3 revisions

The contents of this page are based on the original Firebase Documentation

Set up Firebase and the Dynamic Links SDK

  1. In the Firebase console, open the Dynamic Links section.

  2. If you have not already accepted the terms of service and set a domain for your Dynamic Links, do so when prompted.

    If you already have a Dynamic Links domain, take note of it. You need to provide a Dynamic Links domain when you programmatically create Dynamic Links.

    https://firebase.google.com/docs/dynamic-links/images/dynamic-links-domain.png

  3. Ensure that your app's App Store ID and your App ID prefix is specified in your app's settings. To view and edit your app's settings, go to your Firebase project's Settings page and select your iOS app.

    Confirm that your Firebase project is properly configured to use Dynamic Links in your iOS app by opening the apple-app-site-association file that is hosted on your Dynamic Links domain. For example:

    https://example.page.link/apple-app-site-association

    If your app is connected, the apple-app-site-association file contains a reference to your app's App Store ID and bundle ID. For example:

    {"applinks":{"apps":[],"details":[{"appID":"1234567890.com.example.ios","paths":["/*"]}]}}

    If the details field is empty, double-check that you specified your App ID prefix. Note that your App ID prefix may not be the same as your Team ID.

Add Dynamic Links to your app

import com.tuarua.firebase.DynamicLinksANE;

private var dynamicLinks:DynamicLinksANE;

dynamicLinks = DynamicLinksANE.dynamicLinks;

Create a long link from parameters

var dynamicLink:DynamicLink = new DynamicLink("http://www.tuarua.com", "fq7yh.app.goo.gl");
dynamicLink.iosParameters = new IosParameters("com.tuarua.firebaseane.example");
dynamicLinks.buildDynamicLink(dynamicLink, onDynamicLinkCreated, true);

private function onDynamicLinkCreated(dynamicLinkResult:DynamicLinkResult, error:DynamicLinkError):void {
    trace(dynamicLinkResult.url);
}

Set the length of a short Dynamic Link

var shortLink:DynamicLink = new DynamicLink("http://www.github.com", "fq7yh.app.goo.gl");
dynamicLinks.buildDynamicLink(shortLink, onDynamicLinkCreated, false, true, ShortDynamicLinkSuffix.SHORT);
Clone this wiki locally