Demystifying iBeacons

61
Demystifying iBeacons @fbrunel

description

 

Transcript of Demystifying iBeacons

Page 1: Demystifying iBeacons

Demystifying iBeacons@fbrunel

Page 2: Demystifying iBeacons

What is iBeacon?

Page 3: Demystifying iBeacons

iBeacon is an indoor positioning system

Page 4: Demystifying iBeacons

“a new class of low-powered, low-cost transmitters that

can notify nearby iOS 7 devices of their presence.”

Page 5: Demystifying iBeacons

What it is good for?

Page 6: Demystifying iBeacons

A whole new level of location awareness for

apps

Page 7: Demystifying iBeacons

An app will sense the presence of a beacon

and can react on it

Page 8: Demystifying iBeacons

trail markers in a park, exhibits in a museum, or

product displays in stores

Page 9: Demystifying iBeacons
Page 10: Demystifying iBeacons
Page 11: Demystifying iBeacons

How does it work?

Page 12: Demystifying iBeacons

A thin layer on top of CoreBluetooth exposed

via CoreLocation

Page 13: Demystifying iBeacons

Bluetooth LE has two core concepts

Page 14: Demystifying iBeacons

Devices can act as peripherals or centrals

Page 15: Demystifying iBeacons

Peripherals advertise services and expose

characteristics

Page 16: Demystifying iBeacons

Think of characteristics as object properties

Page 17: Demystifying iBeacons

Centrals scans for services; connects and

read/write characteristics

Page 18: Demystifying iBeacons

A beacon is a peripheral that advertise information

but it’s not a BLE service

Page 19: Demystifying iBeacons

Beacon CentralAd Ad Ad

Page 20: Demystifying iBeacons

Proximity UUID Major Minor Tx Power

Advertisement Packet

Page 21: Demystifying iBeacons

With that, an app can do 4 things

Page 22: Demystifying iBeacons

1. Scan for beacons identified with the same

proximity UUID

Page 23: Demystifying iBeacons

2. Detect if the device is in the region of one or more

beacons (~70m)

Page 24: Demystifying iBeacons

3. Determine the close proximity of a beacon

(ranging)

Page 25: Demystifying iBeacons

4. Use the minor/major integers to

differentiate beacons

Page 26: Demystifying iBeacons

Apple has built iBeacon in the CoreLocation API

Page 27: Demystifying iBeacons

Advertising a Beacon

Page 28: Demystifying iBeacons

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];

Page 29: Demystifying iBeacons

Monitoring Beacon Regions

Page 30: Demystifying iBeacons

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];

Page 31: Demystifying iBeacons

- (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]; } } }

Page 32: Demystifying iBeacons

“One way to promote consistent ranging results

in your app is to use beacon ranging only while

your app is in the foreground.”

Page 33: Demystifying iBeacons

“if your app is in the foreground, it’s likely that the device is in the user’s hand.” — Apple BS Group.

Page 34: Demystifying iBeacons

Mythbusting

iBeacon

Page 35: Demystifying iBeacons

A. Beacons can be precisely located.

Page 36: Demystifying iBeacons

Wrong.

Page 37: Demystifying iBeacons

Location is really approximate due the signal strength and environment

factors

Page 38: Demystifying iBeacons

B. Beacons can push information.

Page 39: Demystifying iBeacons

Nope.

Page 40: Demystifying iBeacons

The app receives only a minor/major number.

It had to fetch information from the network or a local

database

Page 41: Demystifying iBeacons

iOS devices can’t be a beacon and a bluetooth service at the same time.

Page 42: Demystifying iBeacons

C. Beacon can be detected in background.

Page 43: Demystifying iBeacons

Meh.

Page 44: Demystifying iBeacons

Region monitoring changes happens between

4 and 15 minutes

Page 45: Demystifying iBeacons

Ranging doesn’t work in background. You have to

open your app.

Page 46: Demystifying iBeacons

D. A beacon can record who’s around.

Page 47: Demystifying iBeacons

What? No.

Page 48: Demystifying iBeacons

Beacons are just advertising, they are not aware of who’s listening

Page 49: Demystifying iBeacons

Ranging doesn’t work in background. You have to

open your app.

Page 50: Demystifying iBeacons

E. Beacon can do payments.

Page 51: Demystifying iBeacons

LOL. Stop it!

Page 52: Demystifying iBeacons

iBeacon is not enough, it’s just location

Page 53: Demystifying iBeacons

F. iBeacon works on other platforms.

Page 54: Demystifying iBeacons

Yes.

Page 55: Demystifying iBeacons

Support for Android exist via 3rd parties. iBeacon

profile has been documented

Page 56: Demystifying iBeacons
Page 57: Demystifying iBeacons

Not all is lost! It will improve but it’s still

radio technology.

Page 58: Demystifying iBeacons
Page 59: Demystifying iBeacons
Page 60: Demystifying iBeacons
Page 61: Demystifying iBeacons

Thanks.@fbrunel