wnyc / cordova-plugin-wakeuptimer

Cordova plugin for a wakeup alarm clock
90 stars 111 forks source link

Plugin waking up the app too late #31

Open fmgomes opened 6 years ago

fmgomes commented 6 years ago

I'm using this plugin to wake up an app that could be suspended or killed, to generate an alarm at a precise time (like an alarm clock). It works almost perfectly on my phone (only failed once) but noticed that lots of times it fails in another phone (both are from Samsung and have Android 7.0 installed, but the hardware is different - A5 vs S7). I added debug messages to the app and the problem seems to be that when the app was suspended or killed (for example by the Android power manager or manually), sometimes it wakes up a bit late - in the situations I've observed the app was reactivated more than one minute after the time configured in the alarmManager (and as the app validate that it is time to alarm if it is in the correct hour and minute, it doesn't alarm in that situation). I've already checked that this plugin uses the alarmManager.setExact method if the API level is higher than 19 and verified adding debug that it is really using the setExact method. What else could be the problem?

Best regards

Fernando