react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
753 stars 288 forks source link

Need event listener when notification onShow #441

Open muslimmuda15 opened 6 months ago

muslimmuda15 commented 6 months ago

I need event listener when notif is fire by schedule time.

useEffect(() => {
      const type = 'notification';
      PushNotificationIOS.addEventListener(type, onRemoteNotification);
      return () => {
           PushNotificationIOS.removeEventListener(type);
      };
});

const onRemoteNotification = notification => {
      const actionIdentifier = notification.getActionIdentifier();
      console.log('NOTIF ACTION IDENTIFIER :', actionIdentifier);
}

I have no any text in my console when notif is fired.