Docs

Installation

Add react-native-lander to a bare React Native app or an Expo app from npm.

Check your toolchain

react-native-lander needs React Native 0.76 or newer, and builds for iOS 15.1+ and Android API 24+. It works with the New Architecture (the default since 0.76) and with the old architecture through React Native's interop layer.

npx react-native --version

The React Native templates already use these minimums. If your app lowered Android's minSdkVersion below 24, raise it again:

android/build.gradle
buildscript {
    ext {
        minSdkVersion = 24
    }
}

On iOS, keep the deployment target React Native sets (min_ios_version_supported in your Podfile).

Add the package

The current published release is react-native-lander 0.1.1.

npm install react-native-lander@^0.1.1
cd ios && pod install

The package is autolinked: pod install adds the RNLander pod on iOS, and Gradle picks up the Android library on the next build. Rebuild the app after installing (npx react-native run-ios, npx react-native run-android, or your usual Xcode and Android Studio builds). A Metro reload alone does not load new native code.

Source and issues

react-native-lander is published on npm and MIT licensed. The source is mirrored read only at github.com/SwiftwareIO/lander_react_native. Report bugs on its issue tracker.

Import it

Everything you need comes from one import:

import { Lander, useLanderDeepLink } from 'react-native-lander'

The package exports Lander, useLanderDeepLink, LanderLink, LanderError and landerSdkVersion, plus the types LanderShortLink, LanderConfidence, LanderOptions, CreateLinkOptions, TrackEventOptions, LanderSubscription and friends. TypeScript types ship with the package.

What the package adds for you

You do not need to add any native dependencies or code by hand beyond the steps in the setup pages.

  • Android: the library declares the INTERNET permission, which Android merges into your app. It depends on com.android.installreferrer:installreferrer (version 2.2) so it can read the Play Install Referrer once, on first launch, for deferred deep links. Its native module receives App Links on cold and warm start, so you do not need to change MainActivity.
  • iOS: the RNLander pod ships a privacy manifest (PrivacyInfo.xcprivacy). Links reach the SDK through React Native's Linking module, which needs your app to forward URLs to RCTLinkingManager. The current React Native template already does; older apps add a few lines (see iOS setup).

You still need to tell each OS that your app owns your Lander link domain. That is the next step.

Next steps

On this page