This documentation covers @apliko/react-native-deep-link 0.3.0.
Deferred Deep Linking
Deferred deep linking handles a user who taps a link but doesn't have your app yet. After they install and open the app for the first time, the original link is delivered to your listeners automatically with meta.source === 'deferred', instead of landing on the home screen.
- Android: the SDK reads the Google Play Install Referrer on the first launch after install. It is silent (no UI) and on by default. It needs an install from Google Play; a sideloaded build gets no referrer.
- iOS: iOS has no install-referrer API, so the link travels on the clipboard: your landing page's “Open the app” button copies the link before sending the user to the App Store. On first launch the user taps the system Paste button (iOS 16+), so iOS shows no permission prompt. The SDK never reads the clipboard on its own. Off by default; enable it with
enableDeferred: { ios: true }. - Web: not applicable; always off.
A deferred link is delivered only on the first launch of a fresh install (never for existing users who update the app), only when the app wasn't opened by a regular link, and at most once per install. If the store updated the app before its first launch, the install can look like an update, and then no deferred link is delivered. Startup is never blocked: links opened during startup take priority. If Google Play doesn't answer in time, the SDK tries again on a later launch, so the deferred link can arrive on a later launch. If a deferred link doesn't arrive, see Troubleshooting.
Enabling
| Platform | Default | Why |
|---|---|---|
| Android | On | Silent, no UI impact. |
| iOS | Off | Opt in to offer the Paste button; it needs your UI (AplikoPasteHost or AplikoPasteButton). |
AplikoLink.init({ apiKey: 'your-client-api-key', enableDeferred: { ios: true } }); // also offer the Paste button on iOS
AplikoLink.init({ apiKey: 'your-client-api-key', enableDeferred: false }); // off everywhereA boolean sets both platforms; in the object form an omitted key keeps that platform's default.
Setup: nothing to install beyond the package. Rebuild your app once after installing or updating the SDK (cd ios && pod install, or a new Expo / EAS build). Without the native part (Expo Go, or a JavaScript-only update to an older build) deferred linking is off and everything else works; with debug: true the SDK logs why.
Your link flow: this happens automatically when users open your Apliko link. Its page opens the app or Google Play with the full link as the referrer on Android, and on iOS a tap copies the full link before opening the App Store (see your project in the Hub). Only if you send users to the store from your own pages must you carry the full Apliko link yourself, for example https://<your-subdomain>.nvgt.link/abc123: pass it in the Play Store link as the referrer parameter, URL-encoded, or copy it before opening the App Store.
https://play.google.com/store/apps/details?id=your.package&referrer=https%3A%2F%2F<your-subdomain>.nvgt.link%2Fabc123Link format
The deferred link must be the full Apliko link. The SDK also accepts a link that is still URL-encoded once, and removes parameters that stores or ad networks append after the link (for example &utm_source=google-play). The link's own query and fragment are kept whole, campaign parameters included, so the link reaches your listener exactly as a direct open would. One limit: when a plain (not URL-encoded) link already has its own query, parameters a store appended can't be told apart from the link's own and are kept. Apliko's link page hands the link over encoded, which avoids this. The raw value is in getDeferredLinkResult().referrer.
A deferred link is only accepted when its host is a subdomain of nvgt.link (custom domains are not supported yet). Anything else, such as a URL the user copied themselves or a third-party referrer, is ignored: never delivered, never sent to the backend, and never cleared from the user's clipboard.
Result
const result = AplikoLink.getDeferredLinkResult();
if (result.url) {
// a deferred link was delivered (your listeners received it too)
}Always the same shape after init() (before that it throws, like the other methods):
| Field | Value |
|---|---|
url | The deferred link delivered to your listeners, or null. |
data | That link's Apliko data once delivered to a listener, else null. |
source | Where the SDK looked: 'install_referrer' (Android) or 'paste_button' (iOS); null if it didn't look. |
referrer | The raw value seen: Play's referrer (for example utm_source=google-play… for an organic install) or the pasted text. |
isAplikoLink | Whether referrer was an Apliko link. true even when a regular link opened at the same time won and url is null. |
url is null when deferred linking is off, on web, on later launches, for an existing user who updated, when a regular link opened the app, when nothing was found, or before startup has finished. You rarely need this: listeners already receive the deferred link.
Testing
Use AplikoLinkTesting from @apliko/react-native-deep-link/testing in development builds; every method does nothing in release builds. Call both before init().
| Method | Description |
|---|---|
simulateFreshInstall(): Promise<void> | Makes the next init() behave like the first launch after a fresh install. |
setMockDeferredLink(url: string): void | Pretends url arrived as the deferred link (the Play referrer on Android, a pasted link on iOS). Same validation and delivery as a real one, and it respects enableDeferred. It always counts as a fresh install, so it can't test app updates. The mock also needs the SDK's native module, so it doesn't work in Expo Go or in a build made before installing 0.3.0. |
import { AplikoLink } from '@apliko/react-native-deep-link';
import { AplikoLinkTesting } from '@apliko/react-native-deep-link/testing';
// Top-level await doesn't work in React Native's entry file: use a function.
async function startWithMockDeferredLink() {
await AplikoLinkTesting.simulateFreshInstall();
AplikoLinkTesting.setMockDeferredLink('https://<your-subdomain>.nvgt.link/abc123');
AplikoLink.init({ apiKey: 'your-client-api-key', debug: true, enableDeferred: { ios: true } });
}
startWithMockDeferredLink();Privacy & data
- When an Apliko link opens (on your
*.nvgt.linksubdomain): one request to that link with your client key, to fetch the data you saved for it. Nothing is sent for any other link. - No device data: no device identifiers, advertising IDs or fingerprinting.
- Android: on the first launch of a fresh install, the Play install referrer is read on the device. Only an Apliko link is looked up, as above.
- iOS: the SDK never reads the clipboard on its own. It only asks iOS, silently, whether a web link is there; the content arrives only when the user taps the system Paste button.
- Stored on the device: only whether the first launch and the deferred link were handled, so a deferred link is never repeated.
The iOS privacy manifest declares the APIs used and no tracking or collected data types.