3

When the app is in background or closed, received push notifications go to top bar (Notification Center).
Later on tapping one notification will open the app and invoke the onNotification callback for that particular message. In iOS, getDelievedNotifications returns an array of all pending ones.
How to do it in Android?

Thanks.

(edited: I am using https://github.com/zo0r/react-native-push-notification)

kc2
  • 207
  • 3
  • 12

3 Answers3

0

You can use this library - https://github.com/zo0r/react-native-push-notification

Weird thing is that this library supports repeat notifications on Android and the react-native base one supports repeat notifications on IOS devices.

Mukesh Soni
  • 6,646
  • 3
  • 30
  • 37
  • I am using this exact library right now for both platforms. However, I couldn't find explanation from their README on how to get all notifications in Android. Do you by any chance know any resources or example code? – kc2 Mar 28 '18 at 06:26
0

The only way I found to do that in Android is to locally persist the incoming notifications to later check it there is any pending for processing.

WilliamX
  • 357
  • 4
  • 17
0

You can use getDisplayedNotifications using notifee librery

https://notifee.app/react-native/reference/getdisplayednotifications#notifee