I am working on an alarm clock using react native with expo. As I understand, I would need to run a background process to listen to scheduled alarms and then trigger them. From what I found, react native doesn’t support background process using
setTimeout but expo does seem to have an
BackgroundFetch API which might be useful.
BackgroundFetch isn’t available in bare expo (non-manage) apps so that’s out of question. I pretty much need standard alarm functionality so what are the possible ways it can be done without detaching from expo?
hi. i have this issue too. did you find any solution?
Noup. You’re the first one who responded. From the docs, it’s evident that background tasks (such as alarm) where device is sleeping aren’t support by RN. I was hoping someone must have devised or come across a workaround.
I’m trying to achieve something similar. I’ve been using local scheduled notifications but I’m having problems with accuracy. Often (through not always) there’s a delay of up to a minute between the time I schedule the notification for and the time it actually triggers. I can’t figure out what’s causing the delay, or whether it’s just down to the fact scheduled notifications aren’t accurate enough for this kind of use case. @smartidiot did you find any solution that worked for you in the end?
I Think the main problem with local notifications is that the sound is no alarm and can not be spcified. I would also need a proper alarm clock that can be snoozed like normal alarm clocks in the system. Would be cool to not have to eject only for this simple purpose. Is this really something that nobody needs? Seems pretty basic to me, to be honest (but I also do not develop apps for a living, so there is that )
Unfortunately, I’ve notice the exact same problem!
I’ve commented the following bug: https://github.com/expo/expo/issues/5799.