Chapter 7. Putting barcodes in context

 

This chapter covers

  • Taking advantage of your user’s context to create “magic”
  • Geofencing locations with Core Location
  • Determining semantic location with iBeacons

Modern smartphones are uniquely aware of the current context a user is in. Whether you’re moving or standing still, or whether you’re inside a moving car—it feels totally natural to be able to open the Maps app and see your current position on the planet indicated by a pulsating blue dot.

Apple has an uncanny ability to pick the most beneficial technological advancements to be added in each new iOS version, for users as well as developers. The Core Location framework has been part of the iPhone operating system since the first version, but it was originally limited to getting user location by means of WiFi and cell tower triangulation. A three-axis accelerometer was also on board to allow the device to detect its own orientation so that it could rotate the UI to match.

On the second-generation iPhone 3G, Apple added a GPS receiver that further increased the accuracy of Core Location. But because Core Location beautifully abstracts determining the device location, there were almost no changes to the public APIs. The same can be said about the third-generation iPhone 3GS, which added a magnetometer allowing iOS to rotate maps to face the direction the user is looking.

7.1. Understanding multiple layers of context

7.2. Building a YardSale app

7.3. Geofencing store locations

7.4. Enhancing the in-store UI with iBeacons

7.5. Summary