Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

React native background timer stops it's execution

$
0
0

I would like to implement a simple countdown timer in the react-native app, and it should work even if the application is in the background. I've tried to use react-native-background-timer like:

    BackgroundTimer.runBackgroundTimer(() => {      if (seconds <= 0) {        // stop the timer and do some logic.      }      setSeconds((s) => s - 1);    }, 1000);

But the problem is that iOs stops its execution in about 90 seconds. What's the best solution in this case?


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>