How to update latitude & longitudes to server for every 'n' minute(s). When app is in background

I am working on tracking kind of app.


Here i need to update users latitude & longitudes to server for every 'n' minute(s).


If app is in foreground means it's working fine.

But if app is in background means it's working upto 180 seconds only.

How should I achieve this ?

Is there any alternate solution for this other than timer?

I need to send the data to server even if app is in background.



Replies

The only approach that will work for this to use continuous location tracking via the

location
background mode. Be aware that has some significant consequences:
  • It uses a lot of energy, thus seriously reducing the user’s battery life.

  • It’s visible to the user via the large blue status bar.

  • It must be started while your is in the foreground.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi,

I am trying to develop an user tracking application where I need to share the user's location to server every n minutes based on the speed in foreground and background. Also if the user is not moving for 10 minutes then again I need to send the data to server.

When the user is moving it is working fine. But if he remains in the same location then I am not getting the location.



Any inputs will be helpful..