-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PushNotification.getDeliveredNotifications issue #1947
Comments
This looks like an issue in the Android SDK, as the code is a straight-forward wrapper around Notification.getId(). I don't yet know if you could do |
Hi, I suspect that the id send is not a valid int32. Regards, |
@ge0rg you can do it by sending data only and pass data to the local notification method. |
Here's how it looks like when a bunch of backend notifications arrive and we start the app afterwards: Code: PushNotification.getDeliveredNotifications((notifcations) => {
console.log(notifcations);
}); Output (re-formatted for clarity): [
{
"body": "New chat message",
"group": null,
"identifier": "0",
"tag": "JcrkNx5Y6jMGevAsc39Tb4",
"title": null
},
{
"body": "New chat message",
"group": null,
"identifier": "0",
"tag": "3tZHVAjoX6y8vnakLb3SoF",
"title": null
},
{
"body": "New chat message",
"group": null,
"identifier": "0",
"tag": "FbS4ZiHKdts69PdZXjbEst",
"title": null
},
{
"body": "New chat message",
"group": null,
"identifier": "0",
"tag": "NK2M3VLwww5DFLFy8Rqrzc",
"title": null
}
] I'm sending the notifications via FCM, where I can add a @Dallas62 I'd love to send data only and create local notifications. In fact, that is my primary approach. However, in some situations a data notification won't wake up the app, so I fall back to noisy notifications after some minutes if the app doesn't query the API. In that case, I need to later consolidate the FCM notifications that have a body with the local notifications, ideally without causing a new notification sound. |
I will try to look at this, but I think Firebase provide an ID which is not a valid int32. |
Could you provide an alternative API to cancel and modify notifications based on their tag? Maybe internally, you'd need to loop through all existing notifications, check their tag and modify the according one. I have no idea though if Android will allow modifying a notification that has no proper ID. |
I have same problem |
1 similar comment
I have same problem |
I have same issue, and also PushNotification.removeDeliveredNotifications(identifiers) does not delete notifications with 0 identifier. |
I have same issue. Identifier is always "0", and it only happens on Android. |
issue info: android device receives remote notification[use my server send notification to fcm] (app in foreground), then app invoke PushNotification.getDeliveredNotifications. ===>this notification can be remove by using "PushNotification.removeDeliveredNotifications(identifiers)" |
Hi, @Dallas62
PushNotification.getDeliveredNotifications return to me
[{"body": "4", "group": null, "identifier": "0", "tag": "FCM-Notification:78159278", "title": "7"}]
Identifier is "0" for all my remote notifications? What i doing wrong?
How can i use PushNotification.removeDeliveredNotifications(identifiers)?
The text was updated successfully, but these errors were encountered: