Background API call in iOS

Hello,

I am building an enterprise application, where I will be syncing user location to the backend server every 5 min for a period of 12 hr every day. I have enabled location updates and background processing for the app in Xcode, and also will be getting location permission as always from user.

We are able to get the location update from the user for the whole time, but the part where we make the service call to sync with backend is delayed. It works fine for the first couple of minutes, but later we see the delay.

I have also used NWConnection to directly make the service call without using URLSession, this approach is slight better comparatively, but not perfect.

I have made sure "Low power mode" and "Low data mode" is disabled, also "Background App Refresh" is enabled for the application.

I believe it should be possible since may app eg. WhatsApp, Telegram have a feature of sharing live location for up to 8 hrs.

Is there any way where we can achieve this without delay?

Thanks in advance.

Why do you need to keep track of the user's location every 5 minutes and send that to a server for a span of 12 hours? What are you doing that requires this type of behavior?

Background API call in iOS
 
 
Q