I want my app to timeout if there is no activity for 5-10 minutes. I have implemented this logic, where the timer starts running as soon as my user has logged and it works as expected in the foreground so my logout web service is called when the timer reaches its limit.
My problem is that the timer stops as soon a the app is put in the background. Is it possible to implement this function while the app is in the background?
Also another background related issue I have, I use geolocation in my app and when the app has network connection I use watchPosition which keeps going in the background, but I also have some logic when there is no network.
I have limited functionality so I use getCurrentPosition and save to my local database to sync later. I also have a timer running here, so I have the same issues that it stops while in the background.
Should I change to watchPosition so my app will keep the timer running in the background?
My problem is that the timer stops as soon a the app is put in the background. Is it possible to implement this function while the app is in the background?
Also another background related issue I have, I use geolocation in my app and when the app has network connection I use watchPosition which keeps going in the background, but I also have some logic when there is no network.
I have limited functionality so I use getCurrentPosition and save to my local database to sync later. I also have a timer running here, so I have the same issues that it stops while in the background.
Should I change to watchPosition so my app will keep the timer running in the background?




Sarvesh Admuthe