question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trigger notifcation happen multiple times

See original GitHub issue

Your 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:open
  • Created 6 years ago
  • Reactions:5
  • Comments:32 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
katzercommented, Jan 31, 2018

Now I could reproduce. It happens when the components matches now and no count is specified.

3reactions
JoueBiencommented, May 29, 2018

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:

        cordova.plugins.notification.local.schedule({
          title: 'message',
          trigger: {firstAt: time2, every: "minute", count:1},
          foreground: true,
          id: 2
        });

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:

  1. the “just add count” workaround is not a slution to this problem -> it dosen’t work in all uses cases.

  2. Commit b93cf65 which is marked as the fix for this issue dose not solve this issue either.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found