Skip to content

Deep Link Handling in Notifications #71

@moustafadevrn

Description

@moustafadevrn

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:

  1. Attach a deep link to a push notification.
  2. Send the notification to an Android device.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions