Updating gps location in the background on iPhone app

I am building an iPhone app where the AI ​​has to update the location during significant changes. For this I used "[locationManager startMonitoringSignificantLocationChanges]". I have to update the location while the app is running, also in the background. So I gave the required backgrounds as "Location Updates Application Registers" in info.plist. I doubt: Does it need to be specified in info.plist to register background when using startMonitoringSignificantLocationChanges?

If anyone has an idea please help me ... Thanks in advance

+3


source to share


1 answer


Significant location changes will automatically launch your app in the background without the required background mode key. The necessary background modes are only necessary if you are constantly monitoring your location, such as navigating a turntable.

EDIT : This is described in the Location Programming Guide , worth reading:



The preferred option is to use a significant location change service to wake up your application at the appropriate times to handle new events. However, if your application needs to use a standard location service, you can declare your application as requiring a location service.

So, if you are using a significant location change service, it will wake up and you don't need a background mode key. If you are using a standard location service and need to run in the background, you need to specify "location" in the background.

+2


source







All Articles