Learning iBeacon
eBook - ePub

Learning iBeacon

  1. 196 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning iBeacon

Book details
Book preview
Table of contents
Citations

About This Book

Starting with an introduction to iBeacon, you will learn all about simple beacon detection. You will learn how to use Apple's CoreBluetooth, CoreLocation, and PassKit libraries, and how to broadcast different values through the power of transmission power.

You will learn how to allow your apps to detect beacons, determine their distance, and even turn your iPhone or iPad into a Bluetooth iBeacon by building a simple treasure-hunting app. We will also be discussing two of the most popular beacons (Estimote and ROXIMITY). Don't worry if you haven't got any beacons; this book includes a companion app that lets your Mac or MacBook act as a beacon to allow you to jump straight into learning this incredible technology.

By the end of this book, you will have learned how to build apps that interact with the world around them using Bluetooth beacons.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Learning iBeacon by Craig Gilchrist in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Mobile Devices. We have over one million books available in our catalogue for you to explore.

Information

Year
2014
ISBN
9781784397128
Edition
1

Learning iBeacon


Table of Contents

Learning iBeacon
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Welcome to iBeacon
Introducing iBeacon
Hey, 'sup
Understanding a range using RSSI
Compatible devices
Commercial applications of iBeacon
So many vendors, so little time
Estimote
Estimote beacons – pros
Estimote beacons – cons
ROXIMITY
ROXIMITY beacons – pros
ROXIMITY beacons – cons
RedBearLab
RedBear Beacon B1 – pros
RedBear Beacon B1 – cons
Other vendor options
The companion OS X application and website
Using the companion app
Hello world
Let's get started
Adding the Core Location framework
Adding a permission message
Configuring the CLLocationManagerDelegate method
Adding a CLLocationManager instance
Preparing UUID
Start monitoring
Line by line
Testing our code
Summary
2. Detecting Beacons – Showing an Advert
Uses of the UUID/major/minor broadcasting triplet
UUID – Universally Unique Identifier
Major
Minor
An example of a use case
Understanding Core Location
The CLBeaconRegion class
The CLLocationManager class
Creating a CLLocationManager class
Defining a CLLocationManager class line by line
locationManager:didEnterRegion
locationManager:didExitRegion
locationManager:didRangeBeacons:inRegion
locationManager:didChangeAuthorizationStatus
Understanding iBeacon permissions
Location permissions in iOS 8
Enabling the location after denying it
Building the tutorial app
Creating the app
Adding CLOfferViewController
Setting location permission settings
Adding some controls
Setting up our root view controller
Configuring our location manager
Wiring up CLLocationManagerDelegate
Showing the advert
Dismissing the offer
Summary
3. Broadcasting Advertisements – Sending Offers
Introducing the Core Bluetooth framework
Understanding centrals and peripherals
The Core Bluetooth framework, centrals, and peripherals
The CBCentral class
The CBPeripheral class
The CBPeripheralManager class
Obtaining broadcast values from CLBeaconRegion
Measured power (TXPower)
Let's get started
Adding frameworks
Setting up our controls
Creating our views
Wiring up the storyboard
Setting up our view controller
Adding our switch logic
Summary
4. Ranging Beacons – Hunting for Treasure
There be treasure nearby
Understanding distance
Our application
Getting started with building our app
Drawing our initial views
Adding frameworks and project settings
Adding images
Building the root view controller
Building the treasure view controller
Finally, wire it up
Building the hunter view controller
Hunter view controller states
Imports and public properties
Private properties
Loading the view
Entering and exiting the region
Changing the state
Tidying up
Being extra conscientious
Completing the code
Summary
5. Detecting Beacons in the Background – Location Dating
Real-life use cases
An example use case for retail loyalty
An example use case for airline assistance
Handing over responsibility
The CLBeaconRegion options
Passbook integration
Our tutorial app
The scenario
Viewing anatomy
The code
Creating the application
Creating the view
Configuring the app delegate
No ranging in the background
Entering and exiting regions
Clearing out badges
Ranging beacons
Implementing our view controller
Initializing the view
Receiving beacon distance
Choosing a gender
Adding a passbook pass
Testing your application
Testing the beacons
Testing the passbook pass
Summary
6. Leaving Regions – Don't Forget Your Stuff
Raspberry Pi
Ninja Blocks
Nest
Phillips Hue
Belkin WeMo
iBeacon and home automation
Beacon stickers
Our tutorial
Ranging beacons in the background
Tracking locations using background modes
Cheating the system
Building our app
Beginning the app with a database schema
Using a little helper
Master view controller implementation
Configuring the view controller
Fetching data from the Core Data framework
Configuring the table cell
Notifying the user
Inserting new objects
Ranging beacons
Detailed view controller implementation
Configuring the view
Getting and setting properties
Validating input
Finishing off UI
Adding NSLocationAlwaysUsageDescription
Enabling the background mode
Testing your app
Summary
7. Vendor SDKs – Buying and Configuring Beacons
Estimote motes and SDK
ROXIMITY implementation
Choosing the best platform for your requirements
AltBeacon – the open beacon specification
Using Estimote API 2.1
Security
Estimote SDK classes
ESTBeacon
ESTBeaconDelegate
ESTBeaconManager
ESTBeaconManagerDelegate
Let's get building
Adding EstimoteSDK
Adding API access
The helper class
Configuring the master view controller
Configuring our beacon manager
Configuring the detail view controller
Configuring the view
Connecting and disconnecting from beacons
Saving the changes
Creating the view
Testing your application
Summary
8. Advanced Tutorial – iBeacon Museum
Our exhibitions
The museum map
Our app structure
The permission view
The atrium view
The exhibit view
The supporting website
Tracking our user's journey
Our app design
Building the application
Creating the project
Initializing the views
Adding the CoreLocation functionality
Determining the first view
Configuring our permission view
Adding controls
Configuring the exhibit view
Adding controls to the exhibit view
Adding content methods
Ranging beacons
Configuring our atrium view ...

Table of contents

  1. Learning iBeacon