Skip to main content

This documentation covers @apliko/react-native-deep-link 0.3.0.

Enabling

PlatformDefaultWhy
AndroidOnSilent, no UI impact.
iOSOffOpt in to offer the Paste button; it needs your UI (AplikoPasteHost or AplikoPasteButton).
typescript
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 everywhere

A 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.

text
https://play.google.com/store/apps/details?id=your.package&referrer=https%3A%2F%2F<your-subdomain>.nvgt.link%2Fabc123

iOS Paste button

The user taps the system Paste button, so iOS shows no permission alert. A pasted Apliko link is delivered once, to the first listener, with meta.source === 'deferred', and cleared from the clipboard (unless the user copied something else since). Once a link is pasted, every paste UI disappears; the component's own onLink still fires. The components render nothing until enableDeferred: { ios: true } is set, and always on Android, on web and before iOS 16.

The offer belongs to the first launch, like Android's referrer check, so show your paste UI on the first launch (for example in onboarding). On later launches both components render nothing. A deferred link can be offered only when all of these hold: iOS 16+, enableDeferred: { ios: true }, the first launch of a fresh install, the app wasn't opened by a link, and iOS reports a link on the clipboard. They can be mounted before init() runs and appear once the SDK is ready.

Ready-made: AplikoPasteHost

Render it once near your app root. It floats above your app as a card or bottom sheet and opens by itself on the first launch of a fresh install when a link is on the clipboard.

tsx
import { AplikoPasteHost } from '@apliko/react-native-deep-link';

<AplikoPasteHost
  presentation="sheet"                 // or 'floating' (card) with position 'top' | 'bottom'
  title="Pick up where you left off"
  message="Paste the link you copied to open it here."
  containerStyle={{ backgroundColor: '#FFFFFF' }}
  pasteButton={{ displayMode: 'iconAndLabel', backgroundColor: '#0A5CC2', foregroundColor: '#FFFFFF' }}
  onLink={(url) => console.log('Deferred link pasted:', url)}
/>
PropDefaultDescription
mode'auto''auto' opens by itself when offered. 'manual' opens only via AplikoPaste.show() or the trigger. Either way it opens only when a deferred link can be offered.
presentation'floating''floating' card, or 'sheet' (bottom sheet with backdrop).
position'bottom'Floating card position: 'top' or 'bottom'.
title, message, dismissLabelEnglish defaultsYour text around the button.
triggernoneOptional chip, for example { label: 'Came from a link?' }, shown while the card is closed but the offer still stands. Also takes style and textStyle.
containerStyle, titleStyle, messageStyle, dismissStylenoneStyle everything around the system button.
backdropColor'rgba(0,0,0,0.36)'Backdrop color, sheet only.
pasteButtonnoneOptions for the system button (see AplikoPasteButton props).
onLink(url), onInvalidContent(), onDismiss()noneCallbacks.

Open or close it with AplikoPaste.show() and AplikoPaste.hide(). show() does nothing unless a deferred link can be offered on this launch.

Just the button: AplikoPasteButton

Place it in your own screen, such as an onboarding step. It follows the same rules as the host and renders nothing otherwise, so you can leave it in unconditionally.

tsx
import { AplikoPasteButton } from '@apliko/react-native-deep-link';

<AplikoPasteButton displayMode="iconAndLabel" cornerStyle="capsule" style={{ height: 48 }} onLink={(url) => {}} />
PropDefaultDescription
displayMode'iconAndLabel''iconAndLabel', 'iconOnly' or 'labelOnly'.
cornerStyle'capsule''capsule', 'large', 'medium', 'small' or 'fixed'.
backgroundColor, foregroundColorsystemButton colors.
styleheight 48Size and placement.
onLink(url), onInvalidContent()noneAn Apliko link was pasted / the content wasn't one.

The button's text (“Paste”, localized by iOS), font and icon are set by iOS and can't be changed, and it must stay visible: don't cover it or make it transparent. To decide yourself when to show your own UI, call AplikoLink.shouldOfferPaste(); it resolves true on the first launch of a fresh install when a link is on the clipboard (checked silently, without a prompt). One chance per install.

Result

typescript
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):

FieldValue
urlThe deferred link delivered to your listeners, or null.
dataThat link's Apliko data once delivered to a listener, else null.
sourceWhere the SDK looked: 'install_referrer' (Android) or 'paste_button' (iOS); null if it didn't look.
referrerThe raw value seen: Play's referrer (for example utm_source=google-play… for an organic install) or the pasted text.
isAplikoLinkWhether 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().

MethodDescription
simulateFreshInstall(): Promise<void>Makes the next init() behave like the first launch after a fresh install.
setMockDeferredLink(url: string): voidPretends 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.
typescript
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.link subdomain): 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.