addListenerForNotificationOpened is not working in "react-onesignal"

Viewed 35

I am using React package whose name is react-onesignal. I got an issue in the addListenerForNotificationOpened event. My code is:

OneSignalReact.addListenerForNotificationOpened((event: any) => {
  if (event.data.type === 'custom_notification') {
    dispatch(alertActions.setDrawerState());
  }
}).catch((errListener) => { console.log('Error One Signal ', errListener); });

Though I received the notification when I clicked on it, the event (above mentioned) wasn't triggered. If someone faced this issue before kindly let me know the solution (if any).

0 Answers
Related