Hello, get the input values from the user (hour and minute) and i want to trigger a notification everyday at the users input time.I run it on a real android device.Can you help?
I use timer for the users input
change(timer) {
let i = 1;
var hs = timer.time.slice(0, 2);
var mins = timer.time.slice(3, 5);.
//To make them number.
var hours = +hs;
var minutes = +mins;
var displayDate = new Date();
displayDate.setHours(hours);
displayDate.setMinutes(minutes);
if (timer.toggle === true) {
this.localNotifications.schedule({
id: i,
title: 'Hey',
text: "Time to train again!",
trigger: { firstAt: displayDate, every: { hour: hours, minute: minutes } }
});
}
i++;
}
With the code above the notification fires immediately.