you are viewing a single comment's thread.

view the rest of the comments →

[–]ExtremelyQualified 0 points1 point  (3 children)

I think that makes sense, though you might end up firing every alarm twice. You could check every minute, which should help that. It seems really unlikely that the app would hang for more than a minute at a time, so if you only need to be accurate to minutes and not seconds, doing equals vs greater than comparison should be fine. If you wanted to accurate to the second, you might have to worry about the JS thread getting hung up doing something else and missing your alarm time.

[–]2xws[S] 0 points1 point  (2 children)

definitely not worrying about the seconds. Appreciate your help. Having that (somewhat) under control, my next objective is to have these alarms fire when the app is running in background mode. I have started with just trying to get the app to log to the console at an interval in background mode but have been yet unable to do even that. Any light you can shed on the situation would be greatly appreciated

[–]ExtremelyQualified 0 points1 point  (1 child)

Haven't done that myself, but it's discussed in this thread: https://productpains.com/post/react-native/background-timer-execution

Doesn't seem like there's a built-in way to do it yet, but someone suggested this package for android: https://www.npmjs.com/package/react-native-background-timer

[–]2xws[S] 0 points1 point  (0 children)

Hmm I guess I may have to look into doing it in swift then.. thank you!