I am currently working on a mobile application built with Ionic and TypeScript. My goal is to continuously update the user's location every 10 minutes.
My approach involves calling a function at regular intervals, like this:
function updateUserLocation(){
// add your code here
setTimeout(updateUserLocation, (1000 * 60) * 10);
}
updateUserLocation();
However, I have concerns about whether this function will still run even if the application is not actively being used. For example, if the user switches to another app, will this function continue to execute in the background?