IBeacons and Eddystone

12
Building context aware apps with iBeacons and Eddystone Jim Bennett @JimBobBennett http://JimBobBennett.io

Transcript of IBeacons and Eddystone

Page 1: IBeacons and Eddystone

Building context aware apps with iBeacons and

Eddystone

Jim Bennett@JimBobBennetthttp://JimBobBennett.io

Page 2: IBeacons and Eddystone

Overview• A quick overview of beacon technology • What are context aware apps?• What is iBeacon?• What is Eddystone?• Demos

Page 3: IBeacons and Eddystone

What are beacons• Bluetooth LE devices• Broadcast a signal at a defined interval with a

defined data packet• They don’t rely on a client connection, just a

regular, public broadcast• Low power - some run off USB, some run of

batteries with lifetimes in months to years

Page 4: IBeacons and Eddystone

What are context aware apps?

• Context aware apps are aware of some kind of contextual information provided by the devices location relative to the beacons

• Better than GPS as this can work indoor as well as out• Context is based off the location of a beacon, and this

is not necessarily a fixed point• Context is defined by an multi part id• Beacons broadcast a signal strength indicator so the

device can get an approximate distance based off the received signal strength

Page 5: IBeacons and Eddystone

What apps can you build to take advantage of

this?• Museum guide - app knows which exhibit you are

standing next to and plays the correct audio• Stadium location - app can pinpoint your location

and direct you to your seat, and let you know when a beer seller is close by

• Shopping - notifications of special offers when you are next to the items on offer

• Respond to indoor location - turn your lights off when you put your phone down on your bedside table, notify friends when you are home safe

Page 6: IBeacons and Eddystone

Problems!• Security - anyone can read your beacon by

scanning for Bluetooth devices and spoof your id

• Power - some beacons run off the mains so need socket, battery powered ones will die and need replacing

• Accuracy - not very, for example in a busy location people can decrease signal strength

Page 7: IBeacons and Eddystone

What are iBeacons?

• Apple’s beacon specification• Message has an Id, version

(major, minor), measured power

• Multiple iBeacons can have the same Id, versions can be used to distinguish different iBeacons

Page 8: IBeacons and Eddystone

How do they interact with your iOS app?

• Apple defines an API to interact with iBeacons as part of CoreLocation

• Apps can register to monitor a region - all beacons with a given Id

• Monitoring notifies when an iBeacon moves in or out of range

• Monitoring can happen in the background even if your app is terminated and will launch your app

• Once your app is in the foreground, you can range the iBeacons to get their proximity/distance as it changes

Page 9: IBeacons and Eddystone

What is Eddystone?• Google’s beacon specification - recently

announced and open source• Broadcasts one of two possible message

formats• Eddystone UID broadcasts a UID and a

version• Eddystone URL broadcasts a URL (limited

length)• Eddystone TLM goes alongside one of the

other 2 formats and provides telemetry• Beacon broadcasts can wake your Android

app up

Page 10: IBeacons and Eddystone

Which one is better?• Eddystone URL allows discovery - can be detected by

Chrome instead of a custom app• Downside is spamming with too many URLs• Apple provides OS level interaction with iBeacons so can

wake your iOS app up - iBeacons can work on Android with manufacturers SDKs but can’t wake your app up

• Eddystone can interact with the latest Google Play services and wake your Android app up, but not an iOS app

• In the future beacons could broadcast multiple packets to wake apps up on both platforms

Page 11: IBeacons and Eddystone

Using beacons with Xamarin

• iBeacons on iOS is available in CoreLocation• Eddystone on Android is available in Google Play

Services 7.8• Google is releasing a Nearby API for iOS and

Android that supports Eddystone on both platforms - no Xamarin binding yet

• Estimote (a beacon vendor) has a Xamarin component for iOS and Android that supports iBeacon, needs to be updated to support Eddystone

Page 12: IBeacons and Eddystone

Demo time!