zo0r / react-native-push-notification

React Native Local and Remote Notifications
MIT License
6.75k stars 2.05k forks source link

onNotification only running if action not chosen #2370

Closed amilich closed 1 year ago

amilich commented 1 year ago

Question

Hi! I've successfully added notification actions via setNotificationCategories, which is running outside any component right now. It's properly displaying the actions I want.

However, onNotification is only running when I tap the notification itself, not select any of the actions. Does anyone know why this might be?

I've tried moving setNotificationCategories around and using PushNotificationIOS.addEventListener('notification', onNotification) in lots of different places.

amilich commented 1 year ago

Looks a little similar to this: https://github.com/zo0r/react-native-push-notification/issues/1267#issuecomment-610517132

amilich commented 1 year ago

But that issue is still open

amilich commented 1 year ago

fixed this by defining the actions/categories in native. It then properly goes to my onNotification. I suspect something with registering categories in RN is not fully working.