I'm developing an app with cordova and i'm using this plugin to schedule a local notification every day to 6 o'clock https://github.com/katzer/cordova-plugin-local-notifications
Everything works fine, this is the code that i'm using to set de Notification
/*Set 6 o'clock*/ function setTestAlarm() { var notify = new Date(); notify.setHours(18,00,00,00); localNotification.add({ id: 1, title: 'My app', message: 'Hi this is a notification', repeat: 'daily', date: notify, autoCancel: true, ongoing: true, });
I was doing testing , and notification appears every day at 6 pm but only for 9 consecutive days and then stops appearing . What am I doing wrong?
Thanks
Although its late, try the following at: https://github.com/katzer/cordova-plugin-local-notifications/wiki/11.-Samples
cordova.plugins.notification.local.schedule({
id: 1,
text: "Good morning!",
firstAt: tomorrow_at_6_am,
every: "day" // "minute", "hour", "week", "month", "year"
});
For tomorrow_at_6_am
you can try the following:
var today = new Date();
var tomorrow = new Date();
tomorrow.setDate(today.getDate()+1);
tomorrow.setHours(6);
tomorrow.setMinutes(0);
tomorrow.setSeconds(0);
var tomorrow_at_6_am = new Date(tomorrow);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With