The iBeacon Experiment

For the impatient check out the source code and might I warn you that I use iOS 8.0 APIs.

Result

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.

Result

For beacon there are a slew of selections that you can choose from, from the fancy Estimote or if you .. ahem .. a poor developer like me you can make your own beacon or just use this.

Resources

https://github.com/bebensiganteng/Core-Location-Experiments

Leave a Reply

Your email address will not be published. Required fields are marked *