You open a product link while the app is running, land on the right screen, and mark the feature done. Then someone taps the same link with the app closed and lands on Home.
React Native exposes two entry points: Linking.getInitialURL() for the link that launches the app, and the url event for incoming links while it is open. The Linking documentation describes both paths.
Probe both entry points
Temporarily mount this component near your app root. It displays the last received URL without depending on your navigation setup:
import { useEffect, useState } from 'react';
import { Linking, Text } from 'react-native';
export default function LinkProbe() {
const [lastUrl, setLastUrl] = useState('No link received');
useEffect(() => {
let active = true;
const subscription = Linking.addEventListener('url', ({ url }) => {
if (active) setLastUrl(url);
});
Linking.getInitialURL()
.then((url) => {
if (active && url) setLastUrl(url);
})
.catch(() => {
if (active) setLastUrl('Could not read launch URL');
});
return () => {
active = false;
subscription.remove();
};
}, []);
return <Text selectable>{lastUrl}</Text>;
}This is a diagnostic probe, not a router. Your installed app must already register the scheme or associated HTTPS domain. Use a development or release build configured for those links.
Run the same link through three states
Tap a link such as myapp://product/42 from outside the app after replacing myapp with your registered scheme:
- App visible: confirm the incoming event.
- App in the background: confirm it resumes and receives the link.
- App terminated: confirm the launch URL.
If the probe receives the right URL but the wrong screen opens, inspect route parsing, authentication, and navigation readiness. Hold a pending destination until those are ready. If the app never opens, inspect native link registration first; Android's deep-link guide covers intent filters and link testing.
Remove the probe after checking both platforms. Avoid sending raw URLs to production logs: query parameters may contain sensitive values.
Documentation checked October 3, 2026. The probe has not been run on a native device; verify it against your installed React Native version and navigation setup.
End of note
← Back to tips