react-native-pusher-push-notifications
react-native-pusher-push-notifications copied to clipboard
navigate to specific screen after tap on notification
trafficstars
How can we navigate the user to a specific screen when the user tap on notifications?
You need to send a body on the notification from the backend or pusher "debug console" and then handle the notification on "handleNotification" function as it will show you the body of the alert
I'm having similar problem navigating due to the limitation discussed in https://github.com/b8ne/react-native-pusher-push-notifications/issues/97.
Since the instance and event listener has to be called at index.js, I have no access to navigation props to navigate user to certain screen. Have to follow this docs to implement the navigation
RNPusherPushNotifications.on('notification', (payload: any) => {
console.log('PAYLOAD received', payload);
if (payload.data.key === 'profile') {
RootNavigation.navigate('Profile');
}
});