@apliko/react-native-deep-link
v0.2.1
Published
Cross-platform React Native deep linking library with support for Android App Links, iOS Universal Links, and future deferred deep linking. A modern alternative to Firebase Dynamic Links.
Maintainers
Keywords
Readme
@apliko/react-native-deep-link — React Native & Expo Deep Linking SDK
A React Native & Expo Deep Linking SDK — cross-platform, version-agnostic, and built for:
- iOS Universal Links and custom URL schemes
- Android App Links and custom schemes
- React Native Web fallback for browser-based link handling
- Planned deferred deep linking (post-install tracking and routing)
Designed for businesses migrating away from Firebase Dynamic Links (deprecated) and seeking a lighter, more affordable alternative to heavy, high-cost platforms like Branch, AppsFlyer, or OneLink.
Why This Library?
Best choice for: migrating from Firebase Dynamic Links, finding a Branch/AppsFlyer/OneLink alternative, or needing affordable cross-platform deep linking for small and medium businesses.
- Works across iOS, Android, and Web in a single SDK
- Works seamlessly with Expo managed and bare workflows
- No native module installation required — pure JavaScript
- Works with any React Native version (old or new APIs)
- Multiple integration styles — Singleton, Hook, or Provider
- Lightweight bundle size compared to Branch/AppsFlyer SDKs
- Commercial license ensures active maintenance & support beyond free, unsupported tools
Competitor Comparison — Firebase, Branch, AppsFlyer, OneLink
| Platform / SDK | Cost | Vendor Lock-In | SDK Size | Status | |----------------|------|----------------|----------|--------| | Firebase Dynamic Links | Free | Yes | Small | Deprecated (no new links for new projects) | | Branch.io | Paid (tiered plans) | Yes | Large | Active | | AppsFlyer | Paid (enterprise pricing) | Yes | Large | Active | | OneLink (AppsFlyer) | Paid (part of AppsFlyer) | Yes | Large | Active | | @apliko/react-native-deep-link | Paid (SMB-friendly pricing) | Yes | Small | Active & Supported |
Installation
npm install @apliko/react-native-deep-link
# or
yarn add @apliko/react-native-deep-linkNo additional native module installation is needed — this deep linking SDK uses React Native's built-in Linking API, making it compatible with any React Native version.
Quick Start
⚠️ Mandatory:
You must initialize AplikoLink as early as possible (e.g., in your index.js or app entry file) with your API key. Without this, deep link handling will not work, and getInitialUrl() will return null. Debug logging can be enabled during init.
// index.js (or index.ts)
import { AplikoLink } from '@apliko/react-native-deep-link';
import App from './App';
// Initialize immediately with your API key
AplikoLink.init({ apiKey: "your-api-key" });Choose one of the three patterns based on your project's needs.
1. Singleton API - AplikoLinkManager
Best for:
- Complex apps that manually manage subscription lifecycles
- Testing environments where you may want to call
destroy()on the manager
import { AplikoLink } from '@apliko/react-native-deep-link';
// Subscribe to deep link events
const unsubscribe = AplikoLink.addUrlListener((url: string | null, data: UrlSchemeMetaData) => {
console.log('Received deep link:', url);
});
// Retrieve the initial link that launched the app (if any)
const initialUrl = AplikoLink.getInitialUrl();
if (initialUrl) {
console.log('Launched from link:', initialUrl);
}
// Later, unsubscribe to prevent memory leaks
unsubscribe();
This pattern ensures:
- The deep link listener is active before your first component mounts.
- The initial link is retrieved and stored for later retrieval via
getInitialUrl().
2. Hook API - useAplikoLink (Recommended)
Best for:
- Functional components
- Automatic cleanup tied to React lifecycle
import { useAplikoLink } from '@apliko/react-native-deep-link';
export function HomeScreen() {
// Automatically subscribes and unsubscribes when the component mounts/unmounts
useAplikoLink((url: string | null, data: UrlSchemeMetaData) => {
if (url) {
console.log('Deep link received:', url, data);
}
});
return null;
}3. Provider API - AplikoLinkProvider
Best for:
- Centralized deep link handling for the entire app
- Global logging and consistent link processing
import { AplikoLinkProvider } from '@apliko/react-native-deep-link';
function App() {
return (
<AplikoLinkProvider
onLink={(url: string | null, data: UrlSchemeMetaData) => {
console.log('Global deep link:', url, data);
}}
>
{/* App Components */}
</AplikoLinkProvider>
);
}API Reference
AplikoLinkManager
| Method | Returns | Description |
|--------|---------|-------------|
| init(config: { apiKey: string, debug?: boolean }) | void | Initializes the manager with required configuration (e.g., API key). Must be called as early as possible, before using any other methods. |
| addUrlListener(cb: (url: string \| null, data: UrlSchemeMetaData) => void) | () => void | Subscribes to URL changes. Calls cb(url, data) on every new deep link (including the initial link if available). Returns an unsubscribe function. |
| removeAllListeners() | void | Removes all registered listeners. |
| getInitialUrl() | string \| null | Returns and consumes the first link that launched the app. After it is consumed, returns null until next launch. |
| getCurrentUrl() | string \| null | Returns the most recent deep link without consuming it. |
| getDataForUrl(url: string) | Promise | Parse a URL and return metadata. |
| destroy() | void | Completely resets internal state and unsubscribes from platform events (mainly for testing or hot reload). |
useAplikoLink
useAplikoLink(callback: (url: string | null, data: UrlSchemeMetaData) => void): void- callback - Invoked whenever a new deep link is received.
- Cleans up automatically when the component unmounts.
AplikoLinkProvider
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| onLink | (url: string \| null, data: UrlSchemeMetaData) => void | - | Callback invoked for every deep link received. |
| children | React.ReactNode | - | Your app's component tree. |
Platform Setup
This setup ensures reliable delivery of iOS Universal Links, Android App Links, and custom deep link schemes in React Native apps.
iOS Deep Linking Integration
1. Modify AppDelegate
Objective-C
#import <React/RCTLinkingManager.h>
// Handle custom schemes like myapp://path
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
return [RCTLinkingManager application:app openURL:url options:options];
}
// Handle Universal Links like https://nvgt.link/path
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler {
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}Swift
import React
// Handle custom schemes like myapp://path
func application(_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
return RCTLinkingManager.application(app, open: url, options: options)
}
// Handle Universal Links like https://nvgt.link/path
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
return RCTLinkingManager.application(application,
continue: userActivity,
restorationHandler: restorationHandler)
}2. Configure in Xcode
- Custom URL Schemes -> Info -> URL Types -> Add
myapp - Universal Links -> Signing & Capabilities -> Associated Domains -> Add:
applinks:nvgt.link
Android Deep Linking Integration
1. Add intent filters to AndroidManifest.xml
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<!-- Handle custom schemes like myapp://path -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp" android:host="example" />
</intent-filter>
<!-- Handle HTTPS app links -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="nvgt.link" />
</intent-filter>
</activity>Testing
iOS Testing Script
You can test iOS deep links in the simulator with:
xcrun simctl openurl booted "myapp://path"
xcrun simctl openurl booted "https://nvgt.link/path"Android Testing Script
For Android emulators:
adb shell am start -W -a android.intent.action.VIEW -d "myapp://path" com.example
adb shell am start -W -a android.intent.action.VIEW -d "https://nvgt.link/path" com.exampleLicense
This library is proprietary software owned by Apliko Technologies and is provided exclusively to subscribed users under a commercial license agreement.
- Modification, redistribution, or public sharing of this library is strictly prohibited without prior written permission from Apliko Technologies.
- Use of this library is governed by your subscription agreement and the accompanying End User License Agreement (EULA).
Please contact your Apliko Technologies representative for license details or questions regarding permitted usage.
Roadmap
- [ ] Deferred deep linking support (post-install tracking in React Native)
- [ ] Firebase Dynamic Links migration tool
- [ ] Native Turbo Module support
- [ ] Link analytics and parsing
Support
For issues or assistance, contact your Apliko Technologies representative.
