-
Notifications
You must be signed in to change notification settings - Fork 9
Description
When you receive notifications containing deep links and the app is not open, your React Native app fails to detect the deep link URL using the Linking.getInitialURL() method. As a result, the app does not navigate to the appropriate page specified in the deep link URL.
but manually triggering the deep link using the following adb shell command successfully detects the deep link URL:
adb shell am start -a android.intent.action.VIEW -d "com.infobip.mobilemessaging://deeplink/TestDeeplinkingScreen/TestDeeplinkingScreen2" com.example
and Here is the code snippet you are using to handle the initial deep link URL:
function handleInitialDeeplinkUrl() {
Linking.getInitialURL()
.then(initialUrl => {
if (!initialUrl) {
return;
}
console.log(initialUrl);
})
.catch(error => {
console.log('Initial URL is not provided');
});
}
React.useEffect(() => {
handleInitialDeeplinkUrl();
}, []);
Steps to Reproduce:
- Attach a deep link to a push notification.
- Send the notification to an Android device.
- Observe that the app does not navigate to the expected page.
Expected Outcome:
The app should detect the URL and navigate to the expected page.
Actual Outcome:
The app does not detect the URL and therefore does not navigate to the expected page.