I'm trying to navigate to a specific screen when user clicks a notification. I'm using react-native-push-notification and it works great. The problem is, for some reason navigation doesn't happen.
I call this function onNotification, and it's being executed
function onNotificationOpened(notification) {
console.log('navigating')
console.log(NavigationActions)
NavigationActions.navigate('Journal')
}
So 'navigating' is printed on the console, as well as NavigationActions with a function navigate in it. So it's there. But when app opens, navigation doesn't happen and the app stays on the same screen. There's no typo or anything in the screen name. After the app opens I can navigate normally. It doesn't matter if I put navigation there or not, the app still opens on the main screen. I'm thinking that it could be that navigation does happen, but just a bit prior to app itself opens the main screen. I'm not sure of that of course, it's my guess. Am I doing anything wrong here?
what you want to do is similar to deep linking,lock at this ,there are some helpful answers.