The task is to send the user's location to the server every X seconds, the application works perfectly, but in the background after a few minutes, it goes to sleep and stops sending requests.

In Info.plist added:

Privacy - Location Always Usage Description,

Application does not run in background = NO

Required background modes =

App registers for location updates, App downloads content in response to push notifications, App provides Voice over IP services. 

In Capabilities added Background Models: Location updates and VOIP.

But nothing helps

    1 answer 1

    You are from the wrong end. "Send every X seconds" does not work, no matter how hard you try. Timers in the background are disabled. The settings you provide will allow you to send the updated position to the server when the user's location changes. Everything is more than described in detail here: https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html