Need to execute a method to update location to the server continuously for every 2 min after terminating the application in swift

Hi,


I need to update my current location for every 2 minutes to the server in all the stages of the application. Ex: active, background, suspended, terminated.

I have to execute a method to send location to the server when application is in background and also after terminate the application.


As per my knowledge and the information which i got from google, i can able to send my location when application is in background, but when application terminates it is not happening.


Any help will be appreciated.


Thanks in advance.

Replies

First up, I’ve moved your thread to App Frameworks > iOS Multitasking because there’s nothing Swift specific here.

Secondly, in that topic area you’ll find this thread, wherein I explain the problems you’re going to face here. Please read that and then get back to us if you have follow-up questions.

Share and Enjoy

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

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

Hi eskimo,


First of all thanks for your fast reply.


As you said i had gone through that thread and i could able to understand so many things.


My exact requirement is to update the location to the server for every 5 min after terminate the app. Is this possible in any way??

Because somewhere i got some information that we can update information to the server if we use the background location services (if it is a location related app), in that case significant location changes will relaunch the app and we can do the update.


Please confirm


Thanks in advance

My exact requirement is to update the location to the server for every 5 min after terminate the app. Is this possible in any way?

No.

There are situations where an app that’s been terminated by the user is automatically relaunched by the OS. I don’t keep the list of those in my head but IIRC significant location change is one of them. However, you can’t guarantee that this will happen within your 5 minute window.

Even if you could get this to work, I worry about the effect it would have on standby time.

Share and Enjoy

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

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

Thanks for your quick response

We can get the location while app have been terminated using
startMonitoringSignificantLocationChanges
But it will work after moving 500 meters when you terminate the app (current location)

after that application become alive and startupdatelocation method become execute .

Its working fine


But still i am looking for other way that how can i get location everytime even app have been terminated


give any suggesstion ....