Trigger notifcation happen multiple times
See original GitHub issueYour Environment
- Plugin version: lastest
- Platform: Android
- OS version: 7.1
- Device manufacturer / model: Samsung Galaxy S7 Edge
- Cordova version: 7.1.0
- Cordova platform version: android 6.3.0
- Plugin config: trigger schedule
- Ionic Version (if using Ionic): 1.3.0
Expected Behavior
Notification should happen once only on trigger time
Actual Behavior
Notifcation non-stop fire repeatedly in about 5 minutes then stop
Steps to Reproduce
This is my code in app.js. I use ionic v1 with ngCordova
$ionicPlatform.ready(function() {
cordova.plugins.notification.local.schedule({
id: 1,
title: 'test title',
text: 'test description',
trigger: { every: {hour: 10, minute: 0, second: 0} }
});
Context
Fire notication at specific hour every day like 10 am and 4pm every day
Debug logs
Include Android logs
12-14 04:06:04.015 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.017 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.018 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.019 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.020 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.021 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.022 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.023 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.024 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.025 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
12-14 04:06:04.026 30007-30007/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(javascript:cordova.plugins.notification.local.core.fireEvent("trigger",{"id":1,"title":"test title","trigger":{"every":{"hour":4,"minute":5,"second":0},"type":"calendar"},"actions":[],"attachments":[],"autoClear":true,"defaults":0,"foreground":false,"groupSummary":false,"launch":true,"led":true,"lockscreen":true,"number":0,"priority":0,"progressBar":{"enabled":false,"value":0,"maxValue":100,"indeterminate":false},"showWhen":true,"silent":false,"smallIcon":"res:\/\/icon","sound":true,"text":"","vibrate":false,"wakeup":true,"meta":{"plugin":"cordova-plugin-local-notifications","version":"0.9-beta"}},{"event":"trigger","foreground":true,"queued":false,"notification":1}))
A lot of them
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:32 (8 by maintainers)
Top Results From Across the Web
Notification triggered multiple times - ServiceNow Community
Hi community,. We have developed a notification to trigger when a Defect is assigned to a group. The notification triggered multiple times ......
Read more >Duplicated Notifications - OneSignal Documentation
Usually duplicate notifications occur due to sending the same push data multiple times. If you see multiple notifications sent in your Delivery Tab...
Read more >cordova - Local notification "schedule" and "trigger" methods ...
1 Answer 1 ... With your code, every time you click to add a notification, you are adding event handlers for "schedule" and...
Read more >Using the Notifications API - MDN Web Docs
The Notifications API lets a web page or app send notifications that ... a user to receive a lot of notifications in a...
Read more >First things to know about notifications - Microsoft Support
4. There are three ways to get notified ; Then there's chat. This is where your group and one-on-one conversations happen. As you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now I could reproduce. It happens when the components matches now and no
count
is specified.I came across this issue today on an HTC M9 running Android 7.0 with . While adding count will stop the spamming it does not allow the notification to have any repeats (using every doesn’t work when you add count). an example where adding count fails to solve the problem:
In this case the notification is only fired once and then notifications don’t get repeated every minute afterwards. I would suggest reopening this issue because:
the “just add count” workaround is not a slution to this problem -> it dosen’t work in all uses cases.
Commit b93cf65 which is marked as the fix for this issue dose not solve this issue either.