Continuos location tracking refreshes my app

Hello,


I am working on a mapping app which requires location updates from the user. Now when i try to update the location of the user from the background frequently the app goes back to the home page next when i open the app after 30 minutes or so. Now when i comment the code for location tracking and try the same thing the app does not go to the home and stays where i left it even after 30 minutes. The background app refresh is turned off from settings in both the cases


Will the app refresh if i add the location update code? Is there any solution to make it stay on the sceen that i left with location tracking in the background. The app seems to refresh whenever i uncomment the code and the location is being tracked in the background. Any help would be appreciated!


Thanks

Replies

I think your app crashed when you enabled location tracking.

So when you launch the app again, it shows the home page.

Check the crash logs.

If you want your app to reliably return to the state the user left it, you should save that, and restore on new launch. Though you should also figure out why it is reliably being killed, as other reply suggested.