Skip to main content

SDK Integration

Integrate a LinkForty mobile SDK to enable deferred deep linking, attribution tracking, and in-app event analytics. This page is a cross-platform overview — each SDK's complete API lives on its own page.

What the SDK does

  • Deferred deep linking — route new users to specific content after install
  • Direct deep linking — handle links when the app is already installed
  • Install attribution — match installs to the link click that drove them (fingerprint matching, no device IDs required)
  • Event tracking — log in-app events and revenue tied to attribution data

Prerequisites

  1. A LinkForty account (Cloud) or a running self-hosted Core server
  2. Your server's base URL (e.g. https://go.yourdomain.com)
  3. For Cloud: your workspace App Token (at_…, found under Workspace Settings → App Token) — recommended so organic installs are attributed
  4. (Optional) an API key (dl_…, from Settings → API Keys) — only needed if you create links programmatically from the app

Platform SDKs

Pick your platform and follow its full guide:

PlatformInstallFull guide
React Nativenpm install @linkforty/mobile-sdk-react-nativeReact Native SDK
Exponpx expo install @linkforty/mobile-sdk-expoExpo SDK
iOS (Swift)pod 'LinkFortySDK', '~> 1.0' (or Swift Package Manager)iOS SDK
Android (Kotlin)implementation("com.linkforty:sdk:1.3.0")Android SDK
Flutterlinkforty_flutter in pubspec.yamlFlutter SDK

All SDKs share the same flow: initialize → handle the deferred deep link → track events.

How integration works

1. Initialize at app launch

Initialize the SDK as early as possible with your server baseUrl and (for Cloud) your appToken.

React Native:

import LinkForty from '@linkforty/mobile-sdk-react-native';

LinkForty.init({
baseUrl: 'https://go.yourdomain.com',
appToken: 'at_your_app_token', // recommended for Cloud
apiKey: 'dl_your_api_key', // only if you create links from the app
debug: __DEV__,
});

iOS (Swift):

import LinkFortySDK

let config = LinkFortyConfig(
baseURL: "https://go.yourdomain.com",
appToken: "at_your_app_token"
)
try await LinkForty.shared.initialize(config: config)

Android (Kotlin):

import com.linkforty.sdk.LinkForty
import com.linkforty.sdk.LinkFortyConfig

val config = LinkFortyConfig(
baseUrl = "https://go.yourdomain.com",
appToken = "at_your_app_token"
)
LinkForty.initialize(this, config)

Flutter:

import 'package:linkforty_flutter/link_forty.dart';
import 'package:linkforty_flutter/models/link_forty_config.dart';

final config = LinkFortyConfig(
baseUrl: 'https://go.yourdomain.com',
appToken: 'at_your_app_token',
);
await LinkForty.initialize(config: config);

Register a deferred deep link handler. On a new install attributed to a link, it fires with the link's data so you can route the user to the right content. It receives null for organic installs.

React Native:

LinkForty.onDeferredDeepLink((data) => {
if (data) {
// e.g. navigate using data.deepLinkPath / data.customParameters
navigateToContent(data);
}
});

iOS (Swift):

LinkForty.shared.onDeferredDeepLink { deepLinkData in
guard let data = deepLinkData else { return } // organic install
navigateToContent(data)
}

Android (Kotlin):

LinkForty.shared.onDeferredDeepLink { deepLinkData ->
deepLinkData?.let { navigateToContent(it) }
}

Flutter:

LinkForty.instance.onDeferredDeepLink((deepLinkData) {
if (deepLinkData != null) {
navigateToContent(deepLinkData);
}
});

Use the corresponding direct deep link handler (e.g. onDeepLink) to route links opened while the app is already installed — see your platform's SDK page.

3. Track in-app events

Track the actions that matter (signups, purchases) so they're attributed to the originating link. Use the dedicated revenue method for monetary events so amounts aggregate consistently across SDKs.

// React Native
LinkForty.trackEvent('signup', { method: 'email' });
LinkForty.trackRevenue(29.99, 'USD', { productId: 'sku-123', orderId: 'order-456' });

Events appear in the dashboard under Analytics → Events. See Events & Conversions and your platform's SDK page for the exact signatures.

Core concepts

Deferred deep linking

Routes new users to specific content after they install:

  1. User taps a link (e.g. a product page)
  2. App isn't installed → user goes to the App Store / Play Store
  3. User installs and opens the app
  4. The SDK retrieves the attributed link data
  5. Your app navigates to the original content

Attribution

LinkForty matches installs to clicks using device fingerprinting (typically 70%+ accuracy without device IDs), within the link's attribution window. View attributed installs under Analytics → Installs, or per link.

Event tracking

In-app events are tied to the install's attribution, so a purchase made days after install can still be credited to the link and campaign that drove it (within the event attribution window).

Testing your integration

Fingerprint matching is unreliable on simulators/emulators — test on a real device:

  1. Uninstall the app from the device
  2. Tap a test link that points to your app
  3. Install the app from the store (or your dev build)
  4. Open the app
  5. Verify the deferred deep link handler fires with the expected data (enable debug to see logs)
  6. Confirm the install appears under Analytics → Installs

Universal Links let a tapped LinkForty URL open your app directly (instead of the browser) when it's installed. Two pieces are required:

  1. Associated Domains in your app. In Xcode, add the Associated Domains capability to your target and list your link domain:

    applinks:go.yourdomain.com
  2. The Apple App Site Association (AASA) file on your server. LinkForty serves this automatically at /.well-known/apple-app-site-association once you provide your Apple Team ID and bundle ID.

    • LinkForty Cloud: set these in your workspace's app configuration.
    • Self-hosted Core: set the IOS_TEAM_ID and IOS_BUNDLE_ID environment variables. If they're unset, the AASA endpoint returns a 404.

Verify the file is served (no .json extension, application/json content type, over HTTPS):

curl https://go.yourdomain.com/.well-known/apple-app-site-association

See also Universal Links vs App Links.

Android App Links are the equivalent mechanism for opening your app from a verified domain. Two pieces are required:

  1. An intent filter in your AndroidManifest.xml with android:autoVerify="true" for your link host (see the React Native SDK guide for a full example).

  2. The Digital Asset Links file on your server. LinkForty serves this automatically at /.well-known/assetlinks.json once you provide your package name and signing-certificate fingerprints.

    • LinkForty Cloud: set these in your workspace's app configuration.
    • Self-hosted Core: set the ANDROID_PACKAGE_NAME and ANDROID_SHA256_FINGERPRINTS (comma-separated) environment variables. If they're unset, the assetlinks.json endpoint returns a 404.

Verify the file is served:

curl https://go.yourdomain.com/.well-known/assetlinks.json

See also Universal Links vs App Links.

Best practices

  • Initialize early — in your app entry point, before navigation, so the deferred deep link is ready on first launch.
  • Test on real devices — fingerprint matching is unreliable on simulators/emulators.
  • Keep secrets appropriately — the appToken (at_…) is safe to ship in your app bundle; an API key (dl_…) is a secret, so only embed it if you truly need in-app link creation, and load it from a secure config.
  • Track meaningful events — focus on value events (signup, purchase) rather than every interaction; use the revenue method for money.
  • Validate deep link data — don't trust it blindly; verify IDs exist before navigating.

Troubleshooting

  • The attribution window may have expired (user installed too long after clicking)
  • Different network between click and install (VPN, iOS Private Relay) can prevent a fingerprint match
  • Ensure the SDK is initialized before registering the handler
  • Enable debug to see detailed logs, and test on a real device

Events not appearing

  • Events require a successful install report — confirm the SDK has an install ID
  • Check connectivity and your baseUrl
  • Allow 1–2 minutes for events to appear in the dashboard

Lower-than-expected attribution

  • Increase the attribution window if users install later than it allows
  • VPN/proxy usage and cellular↔Wi-Fi switching reduce match accuracy
  • Always measure on real devices

Next Steps

Support