handleLink(url); the SDK sends it to your backend and fires resolved or failed events you can subscribe to.
Subscribe to resolved and failed events (optional)
Register listeners in auseEffect so you can navigate or show errors. Clean up by calling .remove() on the returned subscriptions:
event.url (string), event.metadata (object; currently empty, can be extended later).
Failed event: event.error (string), event.errorCode (e.g. "NETWORK_ERROR", "SERVER_ERROR"), event.originalUrl (string).
Pass every deep link URL to the SDK
Use React Native’sLinking API to get the URL, then call handleLink(url):
- Cold start (app opened from link):
Linking.getInitialURL()thenhandleLink(initialUrl). - Foreground (app already open):
Linking.addEventListener('url', ...)andhandleLink(event.url).
Constraints
| Constraint | Details |
|---|---|
| Android & iOS | Both platforms implement handleLink and emit DeepLinkResolved / DeepLinkFailed. |
| Configure first | Call configure({ apiKey }) before handleLink() or events; otherwise the native side may throw (e.g. “SDK not configured”). |
| Activity required | Call configure() after the app has an Activity (e.g. in root component). Calling too early can yield a NO_ACTIVITY error. |
| Rebuild after install | After adding or updating the package, run npx react-native run-android. Otherwise you get “Native module not found”. |
| Single API key | The SDK keeps one apiKey per process (from the last configure()). All requests use that key. |
handleLink(url) | url must be a non-empty string. |
| Subscriptions | onDeepLinkResolved and onDeepLinkFailed return a subscription; call .remove() in your effect cleanup to avoid leaks. |
| Backend | By default the SDK uses https://api.lorrymithra.in/api/v1/sdk. You can override with configure({ endpoint }). |
Troubleshooting
- Native module not found — Rebuild the app after installing the package (e.g.
cd android && ./gradlew clean && cd ..thennpx react-native run-android). NO_ACTIVITYerror — Callconfigureafter the app has started (e.g. in root component), not from very early bootstrap.- No deep links received — Check that
AndroidManifest.xmlhas the correct<intent-filter>for your scheme/host/path and that you open a URL that matches them.
Next steps
- Create and test links in the Dashboard.
- Use the Track Install API if you need to record installs outside the SDK.

