views:

72

answers:

2

I am working on an application that responds to updates in a device's location. How can I allow my application to continue to receive location updates while it is running in the background? Also, how can I present a notification to the user when they have entered a specific location?

A: 

Very easy to do...i found after solving it... Get a location manager shared instance... make a region of that particular location... do startMonitoringForRegion of location manager(sharedInstance) in your viewcontroller and appdelegate.... and present UILocalNotification in your cllocationmanagerdelegate's didEnterRegion Method...and that's it... magic is startMonitoringForRegion keeps on working in bacgkground also (note---it fires only when a cell tower change --i.e. a significant location change). if u want to recieve continuous location updates (i.e not only significant location changes) ... add a background key as location in your info.plist file and use startupdatinglocation method

Iphone_bharat