katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.57k stars 1.75k forks source link

Property 'timeoutAfter' not cancelling notification #1847

Closed molinet88 closed 2 weeks ago

molinet88 commented 4 years ago

The timeoutAfter property does not cancel the notification.

Your Environment

Expected Behavior

The notification should be cancelled when specifying a duration in milliseconds with the timeoutAfter property.

Actual Behavior

The notification remains visible despite having exceeded the specified milliseconds.

Steps to Reproduce

Create a notification with the timeoutAfter property:

this.localNotifications.schedule(<ILocalNotification>{
  smallIcon: "res://notification_icon.png",
  text: "Notification message",
  trigger: <ILocalNotificationTrigger>{
    at: new Date()
  },
  timeoutAfter: 5000
});

Context

I am trying to cancel the notification 5 seconds after scheduling it.

Debug logs

No logs are displayed.

molinet88 commented 4 years ago

ping

GitFr33 commented 4 years ago

I'm having the same issue. (Using the timkellypa fork with Cordova v. 10 on Android 7.1)

I didn't find documentation of the correct syntax for that option but looking at plugins/cordova-plugin-local-notification/www/local-notification.js it seems that 6000 is correct.