react-native-notifications icon indicating copy to clipboard operation
react-native-notifications copied to clipboard

registerNotificationOpened isn't working as expected in iOS

Open bhanuprakash1226 opened this issue 2 years ago • 1 comments

registerNotificationOpened method isn't working as expected in the scenario: when the app receives a notification in the foreground state and I open the app post killing the app by tapping on a notification.

But the given method is working as expected when the app receives a notification in the killed and background states and opens the app from the killed state by tapping a notification.

Notifications.events().registerNotificationOpened((notification: Notification, completion: () => void, action: NotificationActionResponse) => {
      completion();
});

Using the latest version: 5.1.0 RN version:0.72.5 iOS: 17.1.2

bhanuprakash1226 avatar Dec 18 '23 12:12 bhanuprakash1226

Similar issue here. The workaround was using notifee library for iOS

useEffect(() => {
   if (Platform.OS === 'ios') {
    return notifee.onForegroundEvent(({type, detail}) => {
      switch (type) {
        case EventType.PRESS:
          // Handle notification payload
          }
          break;
      }
    });
     }
  }, []);

katwal-dipak avatar Mar 25 '24 16:03 katwal-dipak

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jan 31 '25 22:01 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Feb 24 '25 23:02 stale[bot]