Closed sudattadesai72 closed 2 days ago
let momentOfFirstAt = moment(currentDateTime);
let firstAt = new Date(momentOfFirstAt.toString());
Aren't you just getting the current date like that, therefore triggering it immediately? Maybe you should add one day to it. That's what I am doing, but it is still not working for me.
I am using the same version. For me, the notification just never triggers. (just tested on Android).
let d = new Date()
d.setDate(d.getDate()+1)
d.setHours(9)
d.setMinutes(0)
d.setSeconds(0)
cordova.plugins.notification.local.schedule({
id: 1,
text: "Time for your daily dose!",
trigger: {
firstAt: d,
every: "day"
}
})
This should create a notification every day at 9AM starting the next day, but I do not receive it. If I leave out every: "day"
it works fine btw.
same problem to me testet on android with cordova-plugin-local-notification 0.9.0-beta.2
same problem
firstAt (or at:) and every not work togheter
I need create a notification every day at same time
this examples works
` var now = new Date().getTime(), _5_sec_from_now = new Date(now + 5 * 1000);
cordova.plugins.notification.local.schedule({
text: "Delayed Notification",
at: _5_sec_from_now,
every: "minute",
led: "FF0000",
sound: null
});`
With every "minute", the first notification start not at 5 seconds from now but at 1' and 5'', without "minute" start after 5 seconds
I solved it. First create a notification object, then pass that object to the schedule method. No need for 'at' or 'firstAt' option.
let notification = {
id: 1,
title: 'TITLE',
text: 'TEXT',
trigger: { every: { hour: 10, minute: 0 } }
};
this.localNotifications.schedule(notification);
This will trigger notification every day at 10:00 from now. If today we passed 10:00 it will start tomorrow. Plugin version: 0.9.3-beta.3 Tested on IONIC3 IOS 11+ :)
@mabuonomo your syntax is for version under 0.9 und should not be valid. @gecsbernat code is working on android with Plugin version: 0.9.3-beta.3 👍
@katche70 in my case the @gecsbernat's code work fine on android (7/8)
@gecsbernat code is working fine on android with Plugin version: 0.9.0-beta.3 👍 Thank you so much!!! Can we customize notification on days and off days for same ??
Thanks in advance.
The notification keeps coming until after the time the time has expired.
I am scheduling a notification on particular dates of a month. But it is repeating everyday with same title. Same code is working on android. But it is not working on iOS version 11.4.Is it possible to trigger a notification without "every" keyword. Please help me. Thanks in adavnce.
The notification keeps coming until after the time the time has expired.
Yeah it keeps beeping until the time has expired
WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
Provide a general summary of the issue.
Your Environment
cordova -v
):7.1.0cordova platform ls
):ios 4.5.4Expected Behavior
Notification should appear every day at specific time.
Actual Behavior
Ios: every parameter not working and notification are not getting triggered. Android : Notification get triggered but not at specific time.
Steps to Reproduce
let momentOfFirstAt = moment(currentDateTime); let firstAt = new Date(momentOfFirstAt.toString()); cordova.plugins.notification.local.schedule({ title: "Daily Reminder", trigger:{ at: firstAt, every: "day" }, foreground:true });
Context
Trying to show a notification everyday at a specific date.
Debug logs
-