Hacker News new | ask | show | jobs
by austinl 4581 days ago
A bit of background - "geofencing" has been around in iOS as part of Core Location since version 4.0. Given latitude and longitude, you can pass in a radius and create a circular region (or specify a set and create a rectangle), with callbacks that trigger when the user enters or exits that region.

One of the main points in the article is that it's particularly battery intensive to update the user's location, so there's a trade off between accuracy and battery usage. To try and solve this, Apple created a hierarchy of accuracy constants, which range from "best" to three kilometers, but it's only somewhat effective at preserving battery life.

The other strategy is monitoring "significant changes" in location, based on cell towers/wifi signals. For this, Apple provides a method called "startMonitoringSignificantLocationChanges" if your app needs to constantly monitor the user's location.

From what the article said, Foursquare is trying to improve these methods by creating probabilistic maps so they can draw better regions for each user, and therefore check for location updates less frequently. I'm assuming there are similar methods for Android.

Here's the documentation for one of the main classes in Core Location called CLRegion: https://developer.apple.com/library/ios/documentation/CoreLo...