cordova-plugin-local-notifications
cordova-plugin-local-notifications copied to clipboard
Notification keep showing as new shedule instead of updating
Notifications keeps showing as new ones instead of staying in background and just update.
I set and check notifications every 5 seconds. First I use this to schedule
$.each(data.reports, function(i, v) {
cordova.plugins.notification.local.schedule({
id: i,
title: v.Title,
text: status,
channel: 'Primary',
priority: 1,
clock: false,
autoClear: true,
wakeup: false,
sticky: false,
lockscreen: false,
foreground: true,
progressBar: {
value: Number(v.Progress)
}
});
});
After this I am updating them
cordova.plugins.notification.local.update({
id: i,
text: status,
sound: false,
progressBar: {
value: progress
}
});
My notification should start, so show popup notification, than should run in background and update progress bar untill 100%. At the end I will remove it.
hmm weird ... mine works fine for this (with the exception of when i do an update call, the action buttons seem to get added every time).
I am using the progress bar though same as you above, on Android 10 (Pixel 3 XL) ... are you sure you're using the correct id value when calling update? Maybe log that out and verify it