售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
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
Adding atrium view controls
Time to test
Summary
9. iBeacon Security – Understanding the Risks
Beacon spoofing
Defending against beacon spoofing
Rotating UUIDs
Beacon hacking
Dispelling security myths
Overcoming users' fears with good UX
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜