Docs

React Native SDK

react-native-lander receives, resolves and creates Lander links in your React Native or Expo app, and reports conversions.

Start a trial before using the SDK

SDK calls require an active trial or subscription. If billing is inactive, the API returns 402 subscription_required. Open your workspace's Billing page to start a trial or restore access. Existing short links continue redirecting.

react-native-lander is the React Native package for Lander. It catches every link that opens your app (Universal Links on iOS, App Links on Android, custom scheme URLs), asks Lander what the link means, and hands your app one tidy LanderLink with the route to open and the data you attached to it.

index.js
import { AppRegistry } from 'react-native'
import { Lander } from 'react-native-lander'
import App from './App'

Lander.initialize({ apiKey: 'pk_live_...', enableLogging: __DEV__ })

AppRegistry.registerComponent('AcmeShop', () => App)
App.tsx
import { useLanderDeepLink } from 'react-native-lander'

export default function App() {
  // Later, once your navigator exists:
  useLanderDeepLink((link) => openRoute(link.route, link))
  // ...
}

That is the whole integration for most apps. The rest of this section explains each piece.

What you get

  • One listener for every link. Cold start, warm start and deferred links (after an install) all arrive through Lander.onDeepLink (or the useLanderDeepLink hook).
  • Nothing lost at startup. Links that arrive before anything listens are buffered and replayed in order, so you can subscribe whenever your navigator is ready.
  • No double navigation. The link that launched the app is delivered exactly once, whether you get it from a listener or from Lander.getInitialLink().
  • Honest attribution. Every link says how sure Lander is: deterministic, probabilistic or unattributed.
  • Unknown links still arrive. A URL Lander does not know (or cannot reach because the device is offline) still reaches your app with its raw URL.
  • Short links from the app. Lander.createLink makes a shareable link for invite and share flows.
  • Conversions that survive offline. Lander.trackEvent writes to an on device queue and sends in batches with retries and deduplication.
  • Expo ready. A config plugin sets up Associated Domains, App Links and your custom scheme during expo prebuild.
  • Privacy first. A random install ID, no fingerprinting, no advertising IDs, no pasteboard reads.

The public API at a glance

MemberWhat it does
Lander.initialize({ apiKey })Starts the SDK. Call once, in your entry file.
Lander.onDeepLink(listener)Calls listener with every LanderLink the app receives. Returns { remove() }.
useLanderDeepLink(listener)The same as a React hook: subscribes while the component is mounted.
Lander.getInitialLink()The link that launched the app (or a deferred link), once.
Lander.claimHandoff(userId)After sign in, returns a link your backend handed off to that user.
Lander.createLink({...})Creates a short link, resolves to a LanderShortLink.
Lander.trackEvent(name, properties?, { linkId? })Records a custom conversion event.
Lander.installIdThe random ID of this install.

Full signatures are in the API reference.

How a tap becomes a screen

  1. Someone taps https://acme.golander.link/p-123.
  2. iOS or Android sees that your app has claimed the domain (Lander hosts the apple-app-site-association and assetlinks.json files for you) and opens the app instead of the browser.
  3. The URL reaches JavaScript: through React Native's Linking on iOS, and through the package's native module on Android.
  4. The SDK calls POST /v1/sdk/resolve on api.golander.link. Lander records the open and answers with the link's route (/product/123), params and attribution labels.
  5. Your onDeepLink listener receives a LanderLink, and your navigator opens link.route.

If the app was not installed, Lander sends the person to the store and, where it can do so honestly, gives the link back on first launch. See Deferred links.

Requirements

Minimum
React Native0.76 (New Architecture or the old architecture)
iOS15.1
AndroidAPI 24 (Android 7.0)
ExpoA development build. Expo Go cannot load the native module.

The current SDK version is 0.1.1.

Get the package

react-native-lander is on npm: npm install react-native-lander. The source is mirrored at github.com/SwiftwareIO/lander_react_native. It is MIT licensed.

Next steps

On this page