cordova-plugin-local-notifications
cordova-plugin-local-notifications copied to clipboard
Property 'timeoutAfter' not cancelling notification
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.
ping
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.