Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geofence API for iOS 5

Tags:

ios

location

gps

I want to build an application that can set up a set amount of geo-fenced square regions across town, I know I could achieve this by enabling location in the background, and check those coordinates to determine if they are in my area of interest.

But that would mean receiving many notifications from the system and would hit the battery performance.

Instead I wondered if there was a new API or possibly an upcoming one that would let you set a geo fence and only be notified by the system if you're inside of that or close by, rather then monitor your location constantly.

Is that possible ?

I found the following question, but I can't find much else: http://www.quora.com/Is-the-geo-fence-functionality-built-into-iOS5s-Reminders-application-available-as-a-public-facing-API

It would seem to me that there is something more to geo fencing then tracking the GPS and comparing to an array of points of interest. If I set the reminders app to remind me that I have to walk my roommates dog tonight when I get in, then I can see the location icon at the top of the screen.

If I open the multitasking bar and remove reminders, the location icon persists, indicating the phone is tracking me, but it's an independent task to the reminders app.

If I set up an application with background location tracking, and remove from multitask bar, the location icon disappears with the application. This makes me believe that there is or will be an API for geo fencing coming for iOS 5.x, this would allow apps to post an array of coordinates to the system and receive local notifications based on the proximity to those points.

Does something similar exist or not yet ?

Thanks

UPDATE FOR FUTURE USERS

There seems to be a limit of 10 regions per app that can be monitored at any time (my personal testing), as this is a shared resource.

Apple Documentation extract:

You should always be judicious when specifying the set of regions to monitor. Regions are a shared system resource and the total number of regions available systemwide is limited.

like image 213
Daniel Avatar asked Dec 12 '11 12:12

Daniel


1 Answers

You should look at the startMonitoringForRegion:desiredAccuracy: method on CLLocationManager.

like image 52
paulbailey Avatar answered Oct 31 '22 11:10

paulbailey