Open erdemakca1 opened 5 years ago
Ok. I its done. Make some changes in plugin files. TriggerReceiver.java, MatchTrigger.java and Request.java
I can give advices and files if anyone needs.
@erdemakca1 I'm having an issue with this too, doing this with Ionic 3:
let date = new Date(2019, 7, 11, 12, 30); // some date in the future.
this.localNotifications.schedule({
id: 1,
title: 'title',
text: 'text',
trigger: {
every: {
weekday: date.getDay(),
hour: date.getHours(),
minute: date.getMinutes()
}
},
priority: 2,
});
But I notice in the iOS logs when I do this that it says [local-notification] Next trigger at: (null)
and the notification does not trigger at the time scheduled.
Can you share your fix for this?
@erdemakca1 actually never mind I found the issue, it appears that the plugin has Sunday as weekday 7
, while for a JS Date object Sunday is weekday 0
. This doesn't appear to be documented so I had to find it out with trial and error...
@Steffaan were you aware of this caveat?
Yes @SimonBrazell Sunday is 7.
Provide a general summary of the issue.
Your Environment
cordova -v
): 9.0.0cordova platform ls
): 8.0.0Expected Behavior
Notifications set to days of the week are working correctly
trigger: {every: {weekday: 3, hour: hour, minute: minutes}}
Actual Behavior
I would like to receive notifications every minute, both on certain days of the week and after the first working moment
Context
I'm creating a recurring new notification for every 1 minute at the time the notification for the day of the week is triggered, but it doesn't work when the application is completely closed.
In fact, the use will work with the second.
trigger: {every: {weekday: 3, hour: hour, minute: minutes, second: second}}