So I tried to make a scheduled alarm/notification with customizable hour and minute field.
What I did basically is :
first create the alarm :
idAlarm = notifications.scheduleNotification( SecondsToAdd, optionsAlarm ) myData.settings.alarmID = idAlarm utility.saveTable(myData.settings, "settings.json") --save
-
default time is 07:00 (24-hours)
-
user can change hour (e.g. from 07 into 14)
-
save the time into settings -> 14:00
-
remove initial alarm using id, create a new one at 14.00
notifications.cancelNotification( idAlarm)
The problem is, the previous alarm was not removed, so I have double alarm/notification.
the next problem is how to make it run daily?
note: for now I just want to make a scheduled notification, not alarm. But if you can provide an example for both I will be happy :D…
Thank you 