Closed akshay19710 closed 2 weeks ago
I'm facing the same issue. I want the user to set a daily reminder at some specific time inside an Ionic App. But the notification is triggered immediatly on iOS. On Android it isn't triggered at all.
Your Environment Plugin version: 0.9.0-beta.3 Platform: iOS OS version: 11.3 Device manufacturer / model: Cordova version (cordova -v): 8.0.0 Cordova platform version (cordova platform ls): Installed platforms: android 7.0.0 ios 4.5.4 Available platforms: browser ~5.0.1 osx ~4.0.1 windows ~5.0.0 www ^3.12.0 Plugin config Ionic Version: 3.20.0
this.localNotifications.schedule({
id: 1,
text: "reminder",
trigger: { every: { hour: new Date(time).getHours(), minute: new Date(time).getMinutes() } }
}, (res) => {
console.log('foo');
});
got it working with the following code:
this.localNotifications.schedule({
id: 1,
title: 'reminder',
text: "reminder",
at: new Date(time),
every: 'day'
}, (res) => {
console.log('foo');
});
@tomIQME Please am in similar needs, can you show your "time" variable, how is it defined? thanks
@dayaki my time variable looks like this: Fri Sep 28 2018 19:00:00 GMT+0200 (CEST)
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
Plugin version: 0.9.0-beta.2 Platform:Android OS version: linux Device manufacturer / model: Cordova version (cordova -v): 8.0.0 Cordova platform version (cordova platform ls): 8.0.0 Plugin config Ionic Version (if using Ionic) 3.19
Expected Behavior
Tell us what should happen
Actually am going to schedule the three daily notifications at three diffrent time but notification fire only once in a day. all of them are fired at a time, 12 PM, 4 PM & 8 PM
cordova.plugins.notification.local.schedule([ { id: 1, title: 'Reminder', foreground: true, text: 'First', data: { mydata: 'Upload food images' }, trigger: { every: 'day', hour: 10 }, }, { id: 2, title: 'Reminder', foreground: true, text: 'Second', data: { mydata: 'Upload food images' }, trigger: { every: 'day', hour: 12 }, }, {
id: 3, title: 'Reminder', foreground: true, text: 'Third', data: { mydata: 'Upload food images' }, trigger: { every: 'day', hour: 16 }, } ]);