Steffaan / cordova-plugin-local-notifications

Cordova Local Notifications Plugin
Apache License 2.0
31 stars 38 forks source link

Notification keep showing as new shedule instead of updating #26

Open templatetuners opened 5 years ago

templatetuners commented 5 years ago

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.

tripflex commented 4 years ago

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