Deep Link is Not Being Cleared

When I open my app with a deep link, I can successfully obtain the URL via Linking.getInitialUrl().

However, when I open the app directly (by tapping the app icon) the initialUrl is still set to whatever it was last set to.

My goal is to have the app follow a deep link when opened via deep link and open normally (with no initialUrl) when opened directly.

To fix this, is there any way to explicitly clear the initial URL? Or perhaps determine whether the app was opened via deep link or directly?

A StackOverflow user had a similar issue: android - Linking.getInitialURL() is not being cleared after used for deeplink - Stack Overflow

The suggested solution is to only open the link if it hasn’t yet been opened. However, this solution does not work for me, because the app should always follow the link when opened via deep link.

SDK Version: 42
Platforms(Android/iOS/web/all): iOS and Android

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.