Hi,
I want to use a countdown in my application but when the screen turns off, it pauses after ~20 sec and resumes when the screen turns on.
Is there a way to fix it ?
Thank you.
4 Answers, 1 is accepted
This plugin works properly
https://github.com/Telerik-Verified-Plugins/Insomnia
But it's not the best option.
Based on your post, I believe that the Cordova Background mode plugin might provide the required functionality. This plugin prevents the app from going to sleep while in the background.
Additionally, to import this plugin in an app, you will need to download it as a ZIP file from GitHub and then follow the procedure outlined here.
Regards,
Preslav
Telerik by Progress
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.
Hi Preslav,
Thank you for your post.
I've already seen this plugin but it seems that there is a problem to publish app's on the appStore
https://github.com/katzer/cordova-plugin-background-mode/issues/122
You are correct. Indeed the app might get rejected from the App Store.
Unfortunately, I was not able to find any other solution that can provide such functionality out of the box.
A possible solution in this situation might be using the pause and resume Cordova events. For example, on pause, you could save the timer in a variable. Once the resume event fires, you could calculate the time and update the countdown timer.
Additionally, you might be interested in the iOS Background Execution article.
Regards,
Preslav
Telerik by Progress
Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.