iBeacons are taking the world by storm allowing developers to leverage Bluetooth Low Energy to give their apps location support that can work just about anywhere including indoors. This give you the ability to enable any number of scenarios based upon device proximity that were never before possible. From retail stores to even sports including the Super Bowl and MLB, you will soon be finding iBeacons just about everywhere. Introduced as a core feature of iOS 7 iBeacon support has now found it's way to Android. You will learn what an iBeacon is, how they work, how you would want to use them, and how to get started making apps in both Android and iOS. All demonstrations will be coded in C#, but will be applicable to any iOS or Android developer in any language.
iBeacons for Everyone, from iOS to Android - James Montemagno | FalafelCON 2014
1. iBeacons for Everyone!
From iOS to Android!
James Montemagno!
Developer Evangelist, Xamarin!
@JamesMontemagno!
2. Who is this guy?!
James Montemagno!
Developer Evangelist, Xamarin!
@JamesMontemagno !
!
http://motzcod.es!
MyStepCounterApp.com!
3. What is an iBeacon?
• Apple calls it:
• “A new class of low-‐powered, low-‐cost
transmitters that can notify iOS devices of
their presence.”
• What does this mean?
• Devices that can notify apps of exact device
proximity and location awareness that was
never before possible.
4. What is it really?
A Device
• What you place around and will
transmits data to your app.
An API
• What you use to detect the devices in
your apps.
11. “Fun” Bluetooth Stats!
Spec
Classic Bluetooth
Bluetooth LE
Distance/Range
100 m (330ft)
50 m (160ft)
(theoretical)
OTA Data
1-3 Mbit/s
1 Mbit/s
Application
throughput
.7-2.1 Mbit/s
.27 Mbit/s
Security
56/128-bit
128-bit AES
Peak current
<30 mA
<15 mA
Consumption
Power Consumption
1 mW
.01 – .5 mW
Latency
100ms
6ms
Voice
YES
NO
12. • GATT (﴾Generic Attribute Profile)﴿
• UUIDs!
• Flow:
Client
• Ini*ate
commands
&
requests
• (Computer
/
Phone)
Server
• Receives
GATT
commands
• (Temperature
Sensor
/
iBeacon)
-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐Attributes -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐
Characteris*cs
• Data
value
transferred
• BaDery
Voltage
Service
• Collec*on
of
related
Characteris*cs
(perform
a
specific
func*on)
• Temperature
measurements
&
*me
intervals
Descriptor
• Provides
addi*onal
informa*on
about
characteris*c
• Units
(F
vs
C)
• Op*onal
How BLE Works!
13. iBeacons Transmit!
• UUID – Universally Unique Identifier
• Region:
• Major Number
• Minor Number
14. They do NOT!
• Push Notifications to Receivers/Devices
• Track Users
17. Region Monitoring!
• Notified on entry/exit of
region
• Works if phone is locked
• Works if app is in
background
18. Ranging!
• Search for all Beacons with specific properties
• Works in foreground
• Proximity Monitoring
• Immediate – Centimeters/Held up to beacon
• Near – 1 to 3 meters
• Far – In detection range
• Unknown – Proximity can not be determined
or ranging has just begun.
20. What can find iBeacons?!
• Your iOS 7.0+ Device
• iPhone 4S, iPad 3rd Gen+, iPad Mini, iPod Touch 5th Gen+
• Your Android Device
• Android 4.3+ (﴾JellyBean)﴿ Devices
• With BLE!
• Nothing on Windows Phone or Windows 8 yet L
41. What’s new in iOS 8!
• More Opt-‐In Features
• Never
• Always
• When App is Open
• Enhanced Home Screen
• Indoor location tracking
42. How iOS 8 Broke Everything!
• Must Request Authorization
1. RequestWhenInUseAuthorization(﴾)﴿;
2. RequestAlwaysAuthorization(﴾)﴿;
• Must add message to Info.plist