@codeonair/deeplink-react-native
v1.0.1
Published
Deep linking SDK for React Native and Expo: Universal Links, Android App Links and deferred deep links after install. A Firebase Dynamic Links alternative.
Maintainers
Readme
@codeonair/deeplink-react-native
Deep linking for React Native and Expo with CodeOnAir AppLinks: Universal Links on iOS, App Links on Android, and deferred deep links that carry the link's path and parameters through the install. A Firebase Dynamic Links alternative, with an Expo config plugin.
Website · React Native guide · Moving from Firebase Dynamic Links
npm install @codeonair/deeplink-react-native @react-native-async-storage/async-storage
npm install react-native-play-install-referrer # recommended: deterministic Android installs
cd ios && pod install1. App ID in the native config
Your App ID is in the dashboard → Settings → App credentials. It's the only thing the app needs — no API key
goes in the app. The SDK reads it with a small native module, so your JavaScript only calls DeepLink.init().
<!-- android/app/src/main/AndroidManifest.xml, inside <application> -->
<meta-data android:name="com.codeonair.APP_ID" android:value="proj_…" /><!-- ios/<App>/Info.plist -->
<key>CodeOnAirAppId</key>
<string>proj_…</string>The SDK sends the App ID and your bundle ID / package name with every request; the server checks both against
your app. It talks to https://app.codeonair.com — to point a build elsewhere (staging, a tunnel), add
com.codeonair.BASE_URL / CodeOnAirBaseUrl, or pass baseUrl to init. Rebuild the app after changing these.
2. Use it
import DeepLink from "@codeonair/deeplink-react-native";
DeepLink.init(); // or DeepLink.init({ debug: true })
const unsubscribe = DeepLink.onLink((link) => navigation.navigate(link.path, link.params));
const url = await DeepLink.createLink({ path: "/product/42", params: { ref: "share" } });
await DeepLink.trackEvent("purchase", { amount: 499 });Apps set up earlier with a publishable key (DeepLink.init("pk_live_…")) keep working.
The API key (sk_live_…, Settings → App credentials) is for the REST API from your servers. Never put it in an app.
3. Native link setup
The SDK listens to Linking for Universal Links, App Links and URI schemes. You still need Associated Domains on
iOS and an autoVerify intent filter on Android (the dashboard's 📱 App setup shows the exact lines). With Expo, the
config plugin adds those and the App ID:
{ "plugins": [["@codeonair/deeplink-react-native", { "appId": "proj_…", "domains": ["yourapp.codeonair.com"], "scheme": "myapp" }]] }iOS clipboard matching is opt-in. Pass a getter, e.g. getClipboardString: () => Clipboard.getStringAsync()
from expo-clipboard.
The platform-independent engine is in src/core.ts and is tested end to end against the CodeOnAir API. Full docs: dashboard.codeonair.com/docs/applink/react-native.
