Skip to main content
The deep links module handles deferred deep links — routing users to the correct screen on first launch after installing from a link.
const deepLink = await AppDNA.deepLinks.checkDeferred();

if (deepLink) {
  // deepLink.screen = "/workout/123"
  // deepLink.params = { ref: "instagram" }
  navigate(deepLink.screen, deepLink.params);
}
checkDeferred should be called once on first launch, typically after configure() completes. Returns null if no deferred link is found.

Module Access

const deepLinks = AppDNA.deepLinks;

Module Methods

MethodSignatureDescription
checkDeferredcheckDeferred(): Promise<DeepLink | null>Check for a deferred deep link
handleIncominghandleIncoming(url: string): voidPass an incoming deep link to the SDK
PropertyTypeDescription
screenstringTarget screen path
paramsRecord<string, string>Additional parameters
sourcestring | nullAttribution source

Event Listeners

const unsubLink = AppDNA.deepLinks.onLinkReceived(
  (url: string, params: Record<string, string>) => {
    route(url, params);
  }
);

const unsubDeferred = AppDNA.deepLinks.onDeferredLinkResolved(
  (deepLink: DeepLink) => {
    route(deepLink.screen, deepLink.params);
  }
);

// Clean up
unsubLink();
unsubDeferred();

Platform Setup

Deep links require platform-specific configuration: iOS: Enable Associated Domains and add applinks:yourapp.com in Xcode. Android: Add intent filters to your AndroidManifest.xml:
<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="https" android:host="yourapp.com" />
</intent-filter>

Auto-Tracked Events

EventTrigger
deep_link_receivedA deep link is opened
deferred_deep_link_resolvedA deferred deep link is resolved on first launch

Full Example

import { AppDNA, DeepLink } from "@appdna/react-native-sdk";
import React, { useEffect } from "react";

function App() {
  useEffect(() => {
    handleFirstLaunch();

    const unsubLink = AppDNA.deepLinks.onLinkReceived((url, params) => {
      route(url, params);
    });

    return () => unsubLink();
  }, []);

  async function handleFirstLaunch() {
    const deepLink = await AppDNA.deepLinks.checkDeferred();

    if (deepLink) {
      route(deepLink.screen, deepLink.params);

      if (deepLink.source) {
        await AppDNA.identify(currentUserId, {
          install_source: deepLink.source,
        });
      }
    } else {
      showOnboarding();
    }
  }

  function route(screen: string, params: Record<string, string>) {
    // Route to the correct screen using your navigation library
  }

  return <>{/* App content */}</>;
}
Deep link routes are configured in the Console under Engagement > Deep Links.