react-native-pusher-push-notifications
react-native-pusher-push-notifications copied to clipboard
How can I use PUSHER with React Navigation?
When I click on the notification it brings me to the main screen of my app. How can I use it to navigate to the specific page that I want it to be on? I am using a stack navigator.
Hi,
I needed the same functionality.
I now used drawer navigator to fix this.
I'm using a custom drawer component :
<Drawer.Navigator initialRouteName="Login" screenOptions={{ gestureEnabled: false }} drawerContent={(props) => <CustomDrawerContentComponent {...props} />}>
and inside my CustomDrawerContentComponent I created my notificationHandler (it's just a component with register and handlenotification functions) and I pass the navigation props to this.
<NotificationHandler navigation={props.navigation} />
Now I can get navigation in my handlenotification function
I don't know if we can do better
Thanks arochedy! Will this work with a Stack Navigator? I mean were u originally using a Stack Navigator then switched to a Drawer Navigator? I can try with the Drawer Navigator too