Demystifying iBeacons

6,607 views

Published on

Published in: Technology, Education

Demystifying iBeacons

  1. 1. Demystifying iBeacons @fbrunel
  2. 2. What is iBeacon?
  3. 3. iBeacon is an indoor positioning system
  4. 4. “a new class of low-powered, low-cost transmitters that can notify nearby iOS 7 devices of their presence.”
  5. 5. What it is good for?
  6. 6. A whole new level of location awareness for apps
  7. 7. An app will sense the presence of a beacon and can react on it
  8. 8. trail markers in a park, exhibits in a museum, or product displays in stores
  9. 9. How does it work?
  10. 10. A thin layer on top of CoreBluetooth exposed via CoreLocation
  11. 11. Bluetooth LE has two core concepts
  12. 12. Devices can act as peripherals or centrals
  13. 13. Peripherals advertise services and expose characteristics
  14. 14. Think of characteristics as object properties
  15. 15. Centrals scans for services; connects and read/write characteristics
  16. 16. A beacon is a peripheral that advertise information but it’s not a BLE service
  17. 17. Beacon Ad Ad Ad Central
  18. 18. Proximity UUID Major Minor Advertisement Packet Tx Power
  19. 19. With that, an app can do 4 things
  20. 20. 1. Scan for beacons identified with the same proximity UUID
  21. 21. 2. Detect if the device is in the region of one or more beacons (~70m)
  22. 22. 3. Determine the close proximity of a beacon (ranging)
  23. 23. 4. Use the minor/major integers to differentiate beacons
  24. 24. Apple has built iBeacon in the CoreLocation API
  25. 25. Advertising a Beacon
  26. 26. NSUUID *proximityUUID = [[NSUUID alloc] initWithUUIDString:@"39ED98FF-2900-441A-802F-9C398FC199D2"]; CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:proximityUUID identifier:@"com.company.region"]; ! NSDictionary *beaconPeripheralData = [beaconRegion peripheralDataWithMeasuredPower:@(-50)]; ! CBPeripheralManager *peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil options:nil]; [peripheralManager startAdvertising:beaconPeripheralData];
  27. 27. Monitoring Beacon Regions
  28. 28. NSUUID *proximityUUID = [[NSUUID alloc] initWithUUIDString:@"39ED98FF-2900-441A-802F-9C398FC199D2"]; CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:proximityUUID identifier:@"com.company.region"]; ! self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; [self.locationManager startMonitoringForRegion:beaconRegion];
  29. 29. - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { [self.locationManager startRangingBeaconsInRegion:region]; } ! - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region { [self.locationManager stopRangingBeaconsInRegion:region]; } ! - (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region { if ([beacons count] > 0) { CLBeacon *nearestExhibit = [beacons firstObject]; ! if (CLProximityNear == nearestExhibit.proximity) { [self presentExhibitInfo:nearestExhibit.major.integerValue]; } else { [self dismissExhibitInfo]; } } }
  30. 30. “One way to promote consistent ranging results in your app is to use beacon ranging only while your app is in the foreground.”
  31. 31. “if your app is in the foreground, it’s likely that the device is in the user’s hand.” — Apple BS Group.
  32. 32. iBea con Mythbusting
  33. 33. A. Beacons can be precisely located.
  34. 34. Wrong.
  35. 35. Location is really approximate due the signal strength and environment factors
  36. 36. B. Beacons can push information.
  37. 37. Nope.
  38. 38. The app receives only a minor/major number. It had to fetch information from the network or a local database
  39. 39. iOS devices can’t be a beacon and a bluetooth service at the same time.
  40. 40. C. Beacon can be detected in background.
  41. 41. Meh.
  42. 42. Region monitoring changes happens between 4 and 15 minutes
  43. 43. Ranging doesn’t work in background. You have to open your app.
  44. 44. D. A beacon can record who’s around.
  45. 45. What? No.
  46. 46. Beacons are just advertising, they are not aware of who’s listening
  47. 47. Ranging doesn’t work in background. You have to open your app.
  48. 48. E. Beacon can do payments.
  49. 49. LOL. Stop it!
  50. 50. iBeacon is not enough, it’s just location
  51. 51. F. iBeacon works on other platforms.
  52. 52. Yes.
  53. 53. Support for Android exist via 3rd parties. iBeacon profile has been documented
  54. 54. Not all is lost! It will improve but it’s still radio technology.
  55. 55. Thanks. @fbrunel

×