Remove scheduled notification from localNotifications

Hi there,

I’m trying to remove scheduled notifications using the localnotifications plugin, but cannot seem to get it to work. When i make the notification i do it as follows:

let insertedId = +idFromDatabase
let scheduleDate = moment().add(1,'minute').format();
this.localNotifications.schedule({
  id: insertedId,
  title: "Generic Title",
  text: "Generic Description",
  trigger: {at: new Date(scheduleDate)},
  led: 'FF0000',
  sound: null,
  data: { listId: insertedId }
});

and i attempt the remove the notification as follows:

this.localNotifications.clear(sameIdAsAbove).then(result => {
  console.log(result); //gives out null
});

However the notification still comes through at it’s scheduled time.

If anyone knows why it is doing this, please do let me know.

Thanks.

  • Matt

I’m trying also to remove Scheduled Notification by using cancel and clear, but still get the other notification on time scheduled. Anyone have a solution on this? Thanks.