React Native Push Notification OnTap Navigation not working

Viewed 10

Hello i am Working Push Notification with the help of this https://github.com/zo0r/react-native-push-notification my notification is working fine but i want to navigate the the screen when i tap on notification ! my notifiaction working fine please help me out with any suggestion i used stack navigator in my routes

here is my code

             onNotification: function (notification) {
          console.log("NOTIFICATIONss:", notification);
          if (notification.userInteraction) {
            console.log("Clicked on Notification"). // here i clicked on notification
            this.props.navigation.push("Home"). // here i want navigation
          }
         
          if (!notification.userInteraction) {
            PushNotification.localNotification({
              foreground:false,
              channelId: notification.channelId,
              channelName: "xShare", // 
              title: notification.title,
              message: notification.message,
              largeIconUrl: notification.smallIcon,
              onOpen: () => { this.props.navigation.navigate("ActiveNeed") },//nothing working
            })
            notification.finish(PushNotificationIOS.FetchResult.NoData);
          }
        },`
0 Answers
Related