[英]How to get all notifications with react-native-push-notification on Android, equivalent to PushNotificationIOS getDeliveredNotifications?
When the app is in background or closed, received push notifications go to top bar (Notification Center).当应用程序处于后台或关闭时,收到推送通知 go 到顶部栏(通知中心)。
Later on tapping one notification will open the app and invoke the onNotification callback for that particular message.稍后点击一个通知将打开应用程序并为该特定消息调用 onNotification 回调。 In iOS, getDelievedNotifications returns an array of all pending ones.
在 iOS 中,getDelievedNotifications 返回所有未决通知的数组。
How to do it in Android? Android怎么办?
Thanks.谢谢。
(edited: I am using https://github.com/zo0r/react-native-push-notification ) (编辑:我正在使用https://github.com/zo0r/react-native-push-notification )
You can use this library - https://github.com/zo0r/react-native-push-notification 您可以使用此库-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. 奇怪的是,该库支持Android上的重复通知,而react-native库支持IOS设备上的重复通知。
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.我在 Android 中找到的唯一方法是在本地保留传入通知,以便稍后检查是否有任何待处理的通知。
You can use getDisplayedNotifications
using notifee librery您可以使用 notifee 库使用
getDisplayedNotifications
https://notifee.app/react-native/reference/getdisplayednotifications#notifee https://notifee.app/react-native/reference/getdisplayednotifications#notifee
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.