wix / react-native-notifications

React Native Notifications
MIT License
3.25k stars 764 forks source link

foreground notifications not working if used with react-navigation #847

Closed sarangzambare closed 2 years ago

sarangzambare commented 2 years ago

If I use react-navigation in my app:

If I do not use react-navigation:

In the docs, it says to refer to the wiki for proper integration with react-native-navigation, but i don't see any relevant wiki there.

Please help.

Platform: ios 15.3.1 react-native-notifications@4.2.4

sarangzambare commented 2 years ago

The issue was because of accidently registering onRecieve call back twice because of poor redux state management. I corrected it and its working now. However, the function associated with background notfif (Notifications.events().registerNotificationReceivedBackground)

is still not getting activated when the app is minimized. For that I will create a separate issue after some debugging.

For anyone facing issues: please check that you are registering your callbacks only once and they are not getting registered again because of other factors like redux/ useState etc . thanks !