Wednesday, February 8, 2023
HomeiOS Developmentswift - Tips on how to maintain iOS app alive whereas in...

swift – Tips on how to maintain iOS app alive whereas in background, longer than 10 minutes?


I discovered this tutorial https://www.raywenderlich.com/5247-core-location-tutorial-for-ios-tracking-visited-locations (you’ll be able to obtain the pattern mission and play with it.) which can observe you by supplying you with lengthy/lat, even when the app is closed or backgrounded, it would proceed to provide the lat/lengthy. Nonetheless, if the app is backgrounded, and I go away the cellphone alone for about 10 minutes, the app appears to enter some sort of “droop” state, wherein once I choose it up once more, the app not observe you (no lat/lengthy) till you deliver the app to the foreground(now you can see the UI), then it would resume monitoring. However I would like this app to proceed monitoring, whereas within the background indefinitely. I do not need it to enter a droop mode.

For testing functions, I made the code:

   locationManager.distanceFilter = 3 // give me lat/lengthy each 3 meters

I attempted lots of issues to get this to work, for instance, I created a recursive perform that can run indefinitely, simply to maintain the app alive. However it didn’t work



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments