Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Glue 2014

Glue 2014

Building apps with iBeacons. How do you build an app using Apple's iBeacons. Why would you want to? What are the challenges and the issues with beacons? Why should we support open beacon HW and SW.

Brian Wilson

May 21, 2014
Tweet

Other Decks in Technology

Transcript

  1. Building Apps with iBeacon Brian Wilson CTO @Kinvey photo credit:

    archer10 (Dennis) (http://www.flickr.com/photos/archer10/3837292679/)
  2. Why you should build with beacons photo credit: Let Ideas

    Compete (http://www.flickr.com/photos/question_everything/3251369226/)
  3. Why you should build with beacons • People exist in

    physical places photo credit: Let Ideas Compete (http://www.flickr.com/photos/question_everything/3251369226/)
  4. Why you should build with beacons • People exist in

    physical places • Context matters photo credit: Let Ideas Compete (http://www.flickr.com/photos/question_everything/3251369226/)
  5. Why you should build with beacons • People exist in

    physical places • Context matters • People need access to data simply photo credit: Let Ideas Compete (http://www.flickr.com/photos/question_everything/3251369226/)
  6. Why you should build with beacons • People exist in

    physical places • Context matters • People need access to data simply • Place is very important to people photo credit: Let Ideas Compete (http://www.flickr.com/photos/question_everything/3251369226/)
  7. Why you should build with beacons • People exist in

    physical places • Context matters • People need access to data simply • Place is very important to people • Where determines when photo credit: Let Ideas Compete (http://www.flickr.com/photos/question_everything/3251369226/)
  8. Why you should build with beacons • People exist in

    physical places • Context matters • People need access to data simply • Place is very important to people • Where determines when • Beacons can tie identity (and data) to location photo credit: Let Ideas Compete (http://www.flickr.com/photos/question_everything/3251369226/)
  9. Why you should build with beacons • People exist in

    physical places • Context matters • People need access to data simply • Place is very important to people • Where determines when • Beacons can tie identity (and data) to location • Beacons can tie identity (and data) to things photo credit: Let Ideas Compete (http://www.flickr.com/photos/question_everything/3251369226/)
  10. Why you should build with beacons • People exist in

    physical places • Context matters • People need access to data simply • Place is very important to people • Where determines when • Beacons can tie identity (and data) to location • Beacons can tie identity (and data) to things • Beacons bring physical context to a digital experience photo credit: Let Ideas Compete (http://www.flickr.com/photos/question_everything/3251369226/)
  11. Bluetooth 4.0 Low Energy Range: ~150 meters (open field) Output

    Power: ~ 10mW (10 dBm) Max Current: ~ 15mA Latency: 3ms Connections: > 2 billion Security: 128bit AES CCM Sleep Current: ~ 1μA Low cost Easy to build Long battery life Support for IoT Advertisement Mesh Networks
  12. BLE RF Energy Characteristics 2.4 GHz GFSK Modulation 2.4 GHz

    is crowded, but advertising is open…
  13. BLE RF Energy Characteristics 2.4 GHz GFSK Modulation 2.4 GHz

    is crowded, but advertising is open… …but not once all Wi-Fi channels are considered
  14. BLE RF Energy Characteristics 2.4 GHz GFSK Modulation 2.4 GHz

    is crowded, but advertising is open… …but not once all Wi-Fi channels are considered There’s also IEEE 802.15.4 (aka ZigBee)
  15. BLE RF Energy Characteristics 2.4 GHz GFSK Modulation 2.4 GHz

    is crowded, but advertising is open… …but not once all Wi-Fi channels are considered There’s also IEEE 802.15.4 (aka ZigBee) Did I mention cordless phones, microwaves, video, and car alarms!
  16. Ok, so what are iBeacons then? • BLE Advertising •

    Apple proprietary • 10 Hz broadcast rate
  17. Ok, so what are iBeacons then? • BLE Advertising •

    Apple proprietary • 10 Hz broadcast rate • UUID, major, minor
  18. Ok, so what are iBeacons then? • BLE Advertising •

    Apple proprietary • 10 Hz broadcast rate • UUID, major, minor • Broadcast power
  19. Ok, so what are iBeacons then? • BLE Advertising •

    Apple proprietary • 10 Hz broadcast rate • UUID, major, minor • Broadcast power • Extension of
 Core Location
  20. Ok, so what are iBeacons then? • BLE Advertising •

    Apple proprietary • 10 Hz broadcast rate • UUID, major, minor • Broadcast power • Extension of
 Core Location • Power friendly
  21. Ok, so what are iBeacons then? • BLE Advertising •

    Apple proprietary • 10 Hz broadcast rate • UUID, major, minor • Broadcast power • Extension of
 Core Location • Power friendly • Supports all
 newer devices
  22. iOS SDK: CLBeacon • Beacon Identity • proximityUUID • major

    • minor • Beacon Range • proximity • accuracy • rssi
  23. iOS SDK: CLBeacon • Beacon Identity • proximityUUID • major

    • minor • Beacon Range • proximity • accuracy • rssi Unique Identifier for Beacon group
  24. iOS SDK: CLBeacon • Beacon Identity • proximityUUID • major

    • minor • Beacon Range • proximity • accuracy • rssi Unique Identifier for Beacon group Most significant unique for beacon
  25. iOS SDK: CLBeacon • Beacon Identity • proximityUUID • major

    • minor • Beacon Range • proximity • accuracy • rssi Unique Identifier for Beacon group Most significant unique for beacon Least significant unique for beacon
  26. iOS SDK: CLBeacon • Beacon Identity • proximityUUID • major

    • minor • Beacon Range • proximity • accuracy • rssi Unique Identifier for Beacon group Most significant unique for beacon Least significant unique for beacon General proximity to beacon
  27. iOS SDK: CLBeacon • Beacon Identity • proximityUUID • major

    • minor • Beacon Range • proximity • accuracy • rssi Unique Identifier for Beacon group Most significant unique for beacon Least significant unique for beacon General proximity to beacon 1σ horizontal accuracy
  28. iOS SDK: CLBeacon • Beacon Identity • proximityUUID • major

    • minor • Beacon Range • proximity • accuracy • rssi Unique Identifier for Beacon group Most significant unique for beacon Least significant unique for beacon General proximity to beacon 1σ horizontal accuracy Average RSSI of received samples (dB)
  29. iOS SDK: CLProximity /* * CLProximity * * Discussion: *

    Represents the current proximity of an entity. * */ typedef NS_ENUM(NSInteger, CLProximity) { CLProximityUnknown, CLProximityImmediate, CLProximityNear, CLProximityFar } NS_ENUM_AVAILABLE_IOS(7_0); You can use the accuracy property to determine which beacon is closest within a proximity
  30. iOS SDK: Summary CLLocationManager CLBeaconRegion startRangingBeaconsInRegion: stopRangingBeaconsInRegion: locationManager:didRangeBeacons:inRegion: Documented in

    Location and Maps Programming Guide
 (https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/ LocationAwarenessPG/Introduction/Introduction.html)
  31. Beacon Region iOS SDK: Boundary Crossing photo credit: Pat Dalton…

    (http://www.flickr.com/photos/27518426@N03/4554375766/)
  32. Beacon Region iOS SDK: Boundary Crossing photo credit: Pat Dalton…

    (http://www.flickr.com/photos/27518426@N03/4554375766/)
  33. Beacon Region locationManager:didEnterRegion iOS SDK: Boundary Crossing photo credit: Pat

    Dalton… (http://www.flickr.com/photos/27518426@N03/4554375766/)
  34. Beacon Region locationManager:didEnterRegion iOS SDK: Boundary Crossing photo credit: Pat

    Dalton… (http://www.flickr.com/photos/27518426@N03/4554375766/)
  35. Beacon Region locationManager:didEnterRegion iOS SDK: Boundary Crossing photo credit: Pat

    Dalton… (http://www.flickr.com/photos/27518426@N03/4554375766/)
  36. Beacon Region locationManager:didRangeBeacons:inRegion: 5m locationManager:didRangeBeacons:inRegion: 0m locationManager:didRangeBeacons:inRegion: 5m iOS SDK:

    Boundary Crossing photo credit: Pat Dalton… (http://www.flickr.com/photos/27518426@N03/4554375766/)
  37. Putting it All Together 1. Monitor a beacon region 2.

    Subscribe to onEntry/ onExit events 3. After entry to the region, start ranging beacons 4. Your app logic here 5. After region exit, stop ranging beacons photo credit: InSapphoWeTrust (http://www.flickr.com/photos/skinnylawyer/7331523378)
  38. Challenges • Notifications come at unpredictable times • Monitored regions

    don’t notify on app restart • CLBeacon is a composite of a number of samples • Accuracy is highly influenced by RF interference • Proximity may be last known value, check accuracy too • Not all iBeacons advertise at 10Hz • Best experience requires user participation • Can’t compare CLBeacons directly • CLBeacons change between delegate calls • Managing beacons and beacon regions is harder than it should be • iOS Only There is help! KCSIBeacon (and others) photo credit: odolphie http://www.flickr.com/photos/odolphie/2849889847/
  39. How do you make compelling iBeacon Apps? Photo Credit: jitze

    (http://www.flickr.com/photos/jitze1942/4870639993/)
  40. How do you make compelling iBeacon Apps? Photo Credit: jitze

    (http://www.flickr.com/photos/jitze1942/4870639993/) You need the cloud ‘
  41. How do you make compelling iBeacon Apps? Photo Credit: jitze

    (http://www.flickr.com/photos/jitze1942/4870639993/) You need the cloud ‘ You need a backend
  42. Use dwell times to serve customers • May I help

    you? Photo Credit: https://flic.kr/p/7EMiZt
  43. Use dwell times to serve customers • May I help

    you? • React intelligently to customer behavior Photo Credit: https://flic.kr/p/7EMiZt
  44. Use dwell times to serve customers • May I help

    you? • React intelligently to customer behavior • Be helpful, not creepy Photo Credit: https://flic.kr/p/7EMiZt
  45. Can we do payments? Not quite (at least right now)

    Beacons spoofing requires user interaction Not reliable enough to make it seamless Expect this in the future photo credit: Nortis (http://www.flickr.com/photos/blomstereng/224657301/)
  46. Ok, what else can’t we do? photo credit: hans s

    (http://www.flickr.com/photos/archeon/2884431258/)
  47. Accuracy μ = 1.4 σ = 0.1 1 meter μ

    = 12.1 σ = 1.3 μ = 19.2 σ = 1.8
  48. iBeacon issues photo credit: Will Montague (http://www.flickr.com/photos/willmontague/3813295674/) iBeacon(Ranging(Available iBeacon Location(Services

    App(Authorization(Status Device(has(appropriate(BLE Bluetooth(is(on Monitoring(Available Enabled Authorized Yes Yes Yes No No No Restricted Denied Disabled • Spoofing • Security • Trust
  49. Don’t be evil Let’s build a beacon community photo credit:

    sk8geek (http://www.flickr.com/photos/sk8geek/10543248844/)
  50. Don’t be evil Let’s build a beacon community We all

    win when users want to use beacon technology photo credit: sk8geek (http://www.flickr.com/photos/sk8geek/10543248844/)
  51. Don’t be evil Let’s build a beacon community We all

    win when users want to use beacon technology Most importantly, remember to have fun and build cool things! photo credit: sk8geek (http://www.flickr.com/photos/sk8geek/10543248844/)
  52. Questions? • Mike Katz’s Wiki on Beacons: bit.ly/ibeaconinfo • My

    Links: https://github.com/EchoAbstract/iBeaconLinks • KCSIBeacon: https://github.com/KinveyLabs/KCSIBeacon • Who’s @ Glue?: bit.ly/ibeaconapp Brian Wilson CTO @ Kinvey Twitter: @EchoAbstract GitHub: EchoAbstract