For the impatient check out the source code and might I warn you that I use iOS 8.0 APIs.
I’ve been watching WWDC 2014 lately and one of the most interesting talk was about Indoor Positioning, the potential is amazing .. or super-annoying :D, sort of like a heat-seeking pop-up ad that follows you around, and of course iOS8 offers a few ways to lessen the pain such as the “What’s near me” app store.
Although is not yet available but I thought it’ll be fun to at least have the basic function running, using CoreLocation is pretty straightforward, the only caveat for iOS8 is;
The NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription are mandatory, you need to provide something that will make sense to the user.
<key>NSLocationAlwaysUsageDescription</key> <string>Please let me always stalk you</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Please let me stalk you only when you use it</string>
and you need to request the authorization.
[locationManager requestAlwaysAuthorization]; [locationManager requestWhenInUseAuthorization];
Other important parts are the battery usage and the user’s flow which surprisingly wasn’t described clearly at the guide, I’ve devised my own so hopefully it will enlighten a few.