-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to cancel the alarm clock #11
Comments
Just reading the source code and it appears to cancel all existing alarms whenever window.wakeuptimer.wakeup() is called. I'm guessing you pass and empty 'alarms' array in the call and it will cancel all alarms. A pretty terrible way to 'cancel an alarm' imo, but I guess its better than nothing :\ |
Hi @se1exin, I'm having trouble removing the alarms the way you described (by passing an empty array). Is there another way? |
Hi @isvaljek, its been nearly a year since I've used this plugin so I may be wrong on this.. Looking at the Android source for WakeupPlugin.java, if you call snooze the plugin will eventually call So I would do something like this: window.wakeuptimer.snooze(
successCallback,
errorCallback,
{
alarms : []
}
); Good luck! |
Thanks @se1exin , but it seems that the cancelAlarms leaves behind a couple of alarms. I'm not sure but if I clear the alarms the way you describe, and then set a single 7-day alarm, I always end up getting one or two previously cleared dates (ghosts) when I run adb shell dumpsys alarm. It seems that clearing daylist type of alarms always leaves last alarm day set. |
@isvaljek I get ya. Sorry but it's been too long so I'm of no more help help here :( Best I can suggest is fork the repo and add the functionality you need |
How to cancel the alarm clock
The text was updated successfully, but these errors were encountered: