react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
731 stars 280 forks source link

Need event listener when notification onShow #441

Open muslimmuda15 opened 1 month ago

muslimmuda15 commented 1 month 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.