Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React native deep linking not working when app is in background state #24620

Closed
DalbirKaur opened this issue Apr 26, 2019 · 3 comments
Closed
Labels
API: Linking Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@DalbirKaur
Copy link

When the app is closed, I am able to get deep link url that is clicked by Linking.getInitialURL(). When the app is in the background state, then nothing is mounted. So, I am not able to get the url even by the Linking.addEventListener('url', method_name).

What is the way to achieve this? Any lead

@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Apr 26, 2019
@matt-oakes
Copy link
Contributor

@DalbirKaur 👋

You need to use the Linking.addEventListener method in some code which is not linked to a React component. Using Redux Saga, RxJS, or similar would be a typical way to do it. When your app returns from the background, you could also check the Linking.getInitialURL() method to get the URL which opened it.

Closing this issue as it's not a bug with React Native. If you need more help, I would advice posting on Stack Overflow.

@JulianKingman
Copy link

@matt-oakes when returning from background, Linking.getInitialUrl() doesn't get the url which opened it, but the previously used url that originally launched it, am I missing something?

@facebook facebook locked as resolved and limited conversation to collaborators May 9, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Linking Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants