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
- A LinkForty account (Cloud) or a running self-hosted Core server
- Your server's base URL (e.g.
https://go.yourdomain.com) - For Cloud: your workspace App Token (
at_…, found under Workspace Settings → App Token) — recommended so organic installs are attributed - (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:
| Platform | Install | Full guide |
|---|---|---|
| React Native | npm install @linkforty/mobile-sdk-react-native | React Native SDK |
| Expo | npx expo install @linkforty/mobile-sdk-expo | Expo SDK |
| iOS (Swift) | pod 'LinkFortySDK', '~> 1.0' (or Swift Package Manager) | iOS SDK |
| Android (Kotlin) | implementation("com.linkforty:sdk:1.3.0") | Android SDK |
| Flutter | linkforty_flutter in pubspec.yaml | Flutter 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);
2. Handle the deferred deep link
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:
- User taps a link (e.g. a product page)
- App isn't installed → user goes to the App Store / Play Store
- User installs and opens the app
- The SDK retrieves the attributed link data
- 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:
- Uninstall the app from the device
- Tap a test link that points to your app
- Install the app from the store (or your dev build)
- Open the app
- Verify the deferred deep link handler fires with the expected data (enable
debugto see logs) - Confirm the install appears under Analytics → Installs
iOS Universal Links
Universal Links let a tapped LinkForty URL open your app directly (instead of the browser) when it's installed. Two pieces are required:
-
Associated Domains in your app. In Xcode, add the Associated Domains capability to your target and list your link domain:
applinks:go.yourdomain.com -
The Apple App Site Association (AASA) file on your server. LinkForty serves this automatically at
/.well-known/apple-app-site-associationonce 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_IDandIOS_BUNDLE_IDenvironment 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
Android App Links are the equivalent mechanism for opening your app from a verified domain. Two pieces are required:
-
An intent filter in your
AndroidManifest.xmlwithandroid:autoVerify="true"for your link host (see the React Native SDK guide for a full example). -
The Digital Asset Links file on your server. LinkForty serves this automatically at
/.well-known/assetlinks.jsononce 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_NAMEandANDROID_SHA256_FINGERPRINTS(comma-separated) environment variables. If they're unset, theassetlinks.jsonendpoint 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
Deferred deep link handler doesn't fire
- 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
debugto 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
- React Native SDK - Complete React Native guide
- iOS SDK - Native iOS integration
- Android SDK - Native Android integration
- Flutter SDK - Flutter integration
- Deferred Deep Linking - How it works
- Analytics - View attribution data
- Creating Links - Create deep links
Support
- Report Issues
- Email: [email protected]