flip icon indicating copy to clipboard operation
flip copied to clipboard

Keep running in Background

Open fgarcia5 opened this issue 3 years ago • 2 comments

I have a countdown running in my App and I need to send alerts at certain times regardless of whether the App is in foreground or in background.

In foreground the "onupdate" event fires correctly but in background it does not.

Here is an example of my implementation in Framework7 App and I attach an screen where it is evident that the "onupdate" is not fired when I move to background. flip-countdown

In the documentation I have not found a way to avoid this "sleep" of the timer. Could you give me any implementation or workaround suggestions?

Thanks in advance

fgarcia5 avatar Jan 20 '21 19:01 fgarcia5

I found a workaround. Commenting these lines: flip-countdown-workaround

And importing Tick object direcly from the file: import Tick from '@pqina/flip/tick/tick.core.module.js';

It doesn't look very fancy but it is a solution.

If there is any better solution, please let me know

fgarcia5 avatar Jan 21 '21 19:01 fgarcia5

To conserve resources the timer will pause when it's invisible, I think atm the above comment is the only way around that.

rikschennink avatar Nov 20 '21 09:11 rikschennink