DEV Community

Alberto Peral
Alberto Peral

Posted on

How to persist countdown in background react native expo

I've tried use a countdown in background in react native expo, i use webview:

        onMessage={() => {

            if (props.initialHour >= finishHour) {
            html: `<script>
          setInterval(()=>{window.ReactNativeWebView.postMessage("");}, ${props.interval})
Enter fullscreen mode Exit fullscreen mode

but only persist interval 5min in background and i've tried setTimeout too and the same results.

How can i do it? without using expo eject

Please help me :( and thank you!

Top comments (0)