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

Using iBeacons in iOS with Swift

Using iBeacons in iOS with Swift

GPS is great for outdoor location sensing. Unfortunately, it falls short indoors. iBeacons pick up where GPS leaves off by providing a means for indoor location sensing using Bluetooth low energy (BLE). In this talk we’ll talk about what iBeacons are, how they work, and when you can use them. We’ll also introduce the programming model to interact with them in iOS using Swift and the Apple CoreLocation framework. Live demo included!

Atomic Object

January 13, 2017
Tweet

More Decks by Atomic Object

Other Decks in Technology

Transcript

  1. ABOUT ME AT O M I C O B J

    E C T M AT T N E D R I C H @ M AT T N E D R I C H M AT T. N E D R I C H @ AT O M I C O B J E C T. C O M
  2. Bluetooth Low Energy (BTLE) device Broadcasts a fixed one-way message

    at a regular time interval Devices can listen for messages and react appropriately WHAT IS AN IBEACON?
  3. GPS works well outside, but doesn’t work well indoors iBeacons

    can pick up this slack Applications Context aware content delivery (advertising) Passive Tracking INDOOR LOCATION SENSING
  4. Museum Place an iBeacon at each exhibit Store (e.g., Walmart)

    Detect when a customer is in a certain aisle, and deliver an advertisement to them CONTEXT AWARE CONTENT DELIVERY
  5. Detect when users walk past houses for sale, or apartments

    for rent Detect when users walk past your business CONTEXT AWARE CONTENT DELIVERY
  6. Stores can place beacons throughout and monitor customers as they

    move Traffic analysis, detect common routes Help detect over and underutilized areas PASSIVE TRACKING
  7. CONFIDENTIAL IDENTIFIED BY THREE NUMBERS U U I D M

    A J O R N U M B E R 2 1 M I N O R N U M B E R 3
  8. Apple defined protocol Many beacon manufacturers Usually offer a companion

    app to connect to and configure their iBeacons BEACON MANUFACTURERS
  9. Each manufacturers beacons vary Battery life Battery replaceability Range Configurability

    Other protocols in addition to iBeacon BEACON MANUFACTURERS
  10. Some manufacturers offer an SDK Can simplify high level operations

    However, you do not need to use this BEACON MANUFACTURERS
  11. BEACON MANUFACTURERS E S T I M O T E

    R A D I U S N E T W O R K S B L U E S E N S E B L U E C AT S
  12. BEACON MANUFACTURERS E S T I M O T E

    R A D I U S N E T W O R K S
  13. CoreLocation framework Hides the BTLE nature of beacons Some abstraction

    overlaps other location mechanisms (e.g., geo fencing) IOS PROGRAMMING MODEL
  14. NSLocationWhenInUseUsageDescription Monitor or range when the user has the app

    open NSLocationAlwaysUsageDescription Monitoring when the app is in the background PERMISSION - INFO.PLIST
  15. CONFIDENTIAL TWO USAGE MODELS M O N I T O

    R I N G R A N G I N G 2 1
  16. Passive Receive ENTER and EXIT events Works in the background

    Can only monitor 20 iBeacons at a time MONITORING
  17. RANGING B ! R A N G E ( FA

    R ) R A N G E ( N E A R ) R A N G E ( I M M E D I AT E )
  18. HTTPS://SHINESOLUTIONS.COM/2014/02/17/THE-BEACON-EXPERIMENTS-LOW-ENERGY-BLUETOOTH-DEVICES-IN-ACTION/ DISTANCE EXPERIMENT BLOG POST Looked at two beacon manufacturers

    Estimate Kontakt Found that accuracy varies between manufacturers and also beacons within a given manufacturer, but distance measures can be decent under certain situations
  19. HOW MUCH DO THEY COST? E S T I M

    O T E R A D I U S N E T W O R K S B L U E C AT S 3 F O R $ 5 9 $ 1 4 3 F O R $ 8 7
  20. Monitoring is allowed Ranging is not However, you can use

    monitoring to wake your app up, and then range periodically BACKGROUND
  21. BEACON IDENTIFICATION If you can’t turn off your beacons, it

    is good to have some way of disabling them Faraday cage - exist on Amazon