Closed Pratikshakhandagale closed 2 weeks ago
I tried the code below, but the notification never triggers every minute. Do you have the same problem as well?
cordova.plugins.notification.local.schedule({
title: 'Sleep App',
text: 'Don\'t forget to log your sleep',
trigger: { every: 'minute', count: 5 },
});
I had the same problem. Solved it using the fork mentioned on the last comment of this #1862 with the explanation about the bug being solved.
cordova plugin add https://github.com/m0dch3n/cordova-plugin-local-notifications.git
and using after installation the following code
cordova.plugins.notification.local.schedule({ id: 50, title: "Delayed Notification", led: "FF0000", sound: 'default', trigger: { every: { hour: 10, minute: 0, second: 0 } }, led: 'FF0000', smallIcon: 'res://mipmap-ldpi/ic_launcher.png', sound: false, vibrate: false });
You can also create one notification for each day of the week.. This solution works also:
` cordova.plugins.notification.local.schedule({ id: 51, title: "Delayed Notification 2", led: "FF0000", sound: 'default', trigger: { every: { weekday: 5, hour: 1, minute: 9, second: 1 }, count: 365 }, led: 'FF0000', smallIcon: 'res://mipmap-ldpi/ic_launcher.png', sound: false, vibrate: false });
cordova.plugins.notification.local.schedule({ id: 52, title: "Delayed Notification 3", led: "FF0000", sound: 'default', trigger: { every: { weekday: 6, hour: 9, minute: 5, second: 1 }, count: 365 }, led: 'FF0000', smallIcon: 'res://mipmap-ldpi/ic_launcher.png', sound: false, vibrate: false });
cordova.plugins.notification.local.schedule({ id: 53, title: "Delayed Notification 3", led: "FF0000", sound: 'default', trigger: { every: { weekday: 0 , hour: 9, minute: 5, second: 1 }, count: 365 }, led: 'FF0000', smallIcon: 'res://mipmap-ldpi/ic_launcher.png', sound: false, vibrate: false }); `
Spend a lot of time to fix this issue, but did not found proper working solution.
Trying to trigger a notification every day at a specific time, but Its works for only 1/2 days. Please let me know, how to fix this issue.
code :