cordova-plugin-local-notifications icon indicating copy to clipboard operation
cordova-plugin-local-notifications copied to clipboard

Property 'timeoutAfter' not cancelling notification

Open molinet88 opened this issue 5 years ago • 2 comments

The timeoutAfter property does not cancel the notification.

Your Environment

  • Plugin version: 0.9.0-beta.3
  • Platform: Android
  • OS version: 6.0.1
  • Device manufacturer / model: Samsung Galaxy J5
  • Cordova version: 9.0.0
  • Cordova platform version: 8.1.0
  • Ionic Version (if using Ionic): 3.20.1

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 avatar Oct 25 '19 10:10 molinet88

ping

molinet88 avatar Nov 14 '19 13:11 molinet88

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.

GitFr33 avatar Aug 27 '20 20:08 GitFr33