The @smler/deferred-link package is a lightweight React Native SDK for deferred deep linking and install attribution. It works on both Android and iOS with full TypeScript support and does not require any heavy third-party attribution SDKs.
What Is Deferred Deep Linking?
Deferred deep linking allows a user to click a link, install your app from the store, and still land on the exact screen that the link pointed to — even though the app was not installed when they clicked.
The Flow
A user clicks a Smler short link (e.g.
https://go.yourdomain.com/abc123).Since the app is not installed, the link opens in the browser.
The browser detects the platform and redirects to the appropriate store:
Android → Google Play Store (with a
referrerparameter)iOS → Apple App Store (after copying the link to the clipboard)
The user installs the app and opens it.
On first launch, the SDK reads the deferred deep link parameters and your app navigates to the correct screen.
Platform-Specific Approaches
Platform | Method | How It Works |
|---|---|---|
Android | Google Play Install Referrer API | Reads the |
iOS | Clipboard Deep Link Detection | Reads the clipboard on first app launch and matches the text against allowed URL patterns. Works even under iCloud Private Relay since it does not rely on IP-based tracking. |
ios | Probabilistic Matching (Fallback) | Analyzes device fingerprint data (manufacturer, model, OS) and matches it against recent click records. Useful when clipboard matching fails on iOS. |
Features
Android Install Referrer — Read, parse, and extract data from Google Play's referrer string
iOS Clipboard Deep Links — Detect deep links with flexible URL pattern matching (wildcards, subdomains, path prefixes)
Deep Link Resolution — Resolve Smler short links to get the original URL, domain, short code, and campaign metadata
Probabilistic Matching — Device fingerprint fallback attribution with confidence scoring
Webhook Notifications — Notify your backend when a deep link is opened (inline or standalone)
Click Tracking — Automatically track clicks from the referrer's clickId
Full TypeScript Support — Every method, parameter, and return type is fully typed
Getting Started
Guide | Description |
|---|---|
Install the SDK, configure iOS and Android, and set up optional peer dependencies. | |
Read and parse the Google Play Install Referrer. Extract UTM params, short codes, and track clicks. | |
Detect deep links from the iOS clipboard with flexible pattern matching. | |
Resolve Smler short links at runtime to get the original URL and metadata. | |
Device fingerprint fallback attribution when other methods fail. | |
Notify your backend and track conversions. | |
Complete reference for all classes, methods, and TypeScript types. |
Quick Example
import { Platform } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { SmlerDeferredLink, HelperReferrer } from '@smler/deferred-link';
async function runDeferredAttribution() {
const isFirstInstall = await AsyncStorage.getItem('smler_first_install');
if (isFirstInstall !== null) return; // Already ran
if (Platform.OS === 'android') {
const info = await SmlerDeferredLink.getInstallReferrerAndroid();
const params = SmlerDeferredLink.parseReferrerParams(info);
// Route based on params.utm_campaign, etc.
} else if (Platform.OS === 'ios') {
const result = await SmlerDeferredLink.getInstallReferrerIos({
deepLinks: ['https://yourdomain.com', 'yourdomain.com'],
});
if (result) {
// Clipboard match — resolve and navigate
const data = await SmlerDeferredLink.resolveDeepLink(
result.fullDeepLink,
{ triggerWebhook: true }
);
// Navigate based on data.originalUrl
} else {
// Fallback to probabilistic matching
const match = await HelperReferrer.getProbabilisticMatch({
domain: 'yourdomain.com',
});
if (match.matched && (match.score ?? 0) > 0.65) {
// Navigate based on match.pathParams
}
}
}
await AsyncStorage.setItem('smler_first_install', 'done');
}
Published with LeafPad