I am working on a react native app for users to track their gym workouts. I wanted to start a timer when the user starts their workout. During their workout they will type in information and then most likely lock the phone and maybe even use other apps during their workout. Running a simple setInterval to keep track of the time does not work because once the app is in the background no JS is able to run anymore. I found this library that uses native code https://github.com/ocetnik/react-native-background-timer to keep your javascript running in the background but it seems to have some bugs at the moment. I found that after 10 seconds in the background the JS logic stops running.
react-native: "0.60.5