Kashif Jilani
Kashif Jilani

Reputation: 1257

How to update location from background in iPhone

I am making an application in which i need to update the location from background when user presses the home button, i have already added in the info.plist in UIBackGroundModes for updateuserlocation, please let me know apart from this anything else is there that have to me do, like have to start location manager for updating please help me

Upvotes: 1

Views: 581

Answers (1)

Craig Stanford
Craig Stanford

Reputation: 1803

It sounds like you want to use a CLLocationManager and call startUpdatingLocation from within the App Delegate applicationDidEnterBackground.

However, this will cause a major drain on the battery & isn't recommended. Instead, you should probably use startMonitoringSignificantLocationChanges to keep the location checking at a minimum.

Upvotes: 1

Related Questions