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.
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)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 theuseLanderDeepLinkhook). - 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,probabilisticorunattributed. - 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.createLinkmakes a shareable link for invite and share flows. - Conversions that survive offline.
Lander.trackEventwrites 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
| Member | What 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.installId | The random ID of this install. |
Full signatures are in the API reference.
How a tap becomes a screen
- Someone taps
https://acme.golander.link/p-123. - iOS or Android sees that your app has claimed the domain (Lander hosts the
apple-app-site-associationandassetlinks.jsonfiles for you) and opens the app instead of the browser. - The URL reaches JavaScript: through React Native's
Linkingon iOS, and through the package's native module on Android. - The SDK calls
POST /v1/sdk/resolveonapi.golander.link. Lander records the open and answers with the link's route (/product/123), params and attribution labels. - Your
onDeepLinklistener receives aLanderLink, and your navigator openslink.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 Native | 0.76 (New Architecture or the old architecture) |
| iOS | 15.1 |
| Android | API 24 (Android 7.0) |
| Expo | A 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.