DEV Community

Discussion on: Background Services in Ionic Capacitor

Collapse
 
hamzahalvanaa profile image
Lordrauf

how about to call the function every minute, for example, every 5 minutes?

Thread Thread
 
karandpr profile image
Karan Gandhi

You can't. The time limit for iOS is 180 seconds and android implementations vary a lot. Doze mode, battery optimizations, and things like that. You can check this website to check the different vendor implementations.
Depending on the use case you can design custom solutions.
One of the ways to actually force an app in foreground via silent push notifications and native background tasks. Or a combination of silent and full push.
However, this is not possible in Ionic/Cordova/Capacitor. As such you will have to dabble into Native Programming.