Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gps location update in background in iPhone app

I am creating an iPhone app,in which AI have to update the location during significant change.For that I have used "[locationManager startMonitoringSignificantLocationChanges]". I have to update the location during the app is in background also.So I have given Required background Modes as "App registers for location update" in the info.plist . My doubt is: Is that necessary to give it in info.plist for background registration, when using startMonitoringSignificantLocationChanges?

If any body has idea then please help me... Thanks in advance

like image 875
Anand Avatar asked Dec 20 '25 02:12

Anand


1 Answers

The significant location changes will automatically start your app in the background without the required background modes key. Required background modes is only needed if you're continuously monitoring location like a street navigation turn by turn app.

EDIT: this is covered in the Location Awareness Programming Guide, it is worth reading:

The preferred option is to use the significant location change service to wake your app at appropriate times to handle new events. However, if your app needs to use the standard location service, you can declare your app as needing background location services.

So if you are using significant location change service, it will be woken up and you don't need the background modes key. If you are using standard location service and must run in the background then you need the background modes key "location".

like image 52
progrmr Avatar answered Dec 24 '25 10:12

progrmr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!