Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning ibeacon

You're reading from  Learning ibeacon

Product type Book
Published in Nov 2014
Publisher
ISBN-13 9781784397128
Pages 196 pages
Edition 1st Edition
Languages
Author (1):
Craig Gilchrist Craig Gilchrist
Profile icon Craig Gilchrist

Table of Contents (16) Chapters

Learning iBeacon
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Welcome to iBeacon Detecting Beacons – Showing an Advert Broadcasting Advertisements – Sending Offers Ranging Beacons – Hunting for Treasure Detecting Beacons in the Background – Location Dating Leaving Regions – Don't Forget Your Stuff Vendor SDKs – Buying and Configuring Beacons Advanced Tutorial – iBeacon Museum iBeacon Security – Understanding the Risks Index

Preface

The iBeacon technology is the most disruptive technology in the field of interaction design. Formally, iBeacon is simply a protocol defined by Apple and built on top of Bluetooth 4.0. Creatively, iBeacon is your passport to apps that truly interact with the world around them.

Imagine your shopping list becoming an interactive map of the supermarket, your phone turning the porch lights on as you drive down the street, or ordering your meal at your favorite table in your favorite restaurant without ever speaking with a waiter. All this and more is made possible with iBeacon.

Taking a practical and pragmatic approach, this book will introduce you to the concepts and applications of iBeacon technology for providing proximity-based solutions to iOS devices. We cover everything from prototyping simple scenarios to building a fully-functional interactive museum app, all using Xcode and Apple's Core Location and Core Bluetooth frameworks.

This book is designed to cover easy-to-follow examples to introduce the core features of iBeacon technology solutions, from discovering beacons and using your iOS device as a beacon, to some more powerful tutorials that closely match real-world examples.

Everything in this book can be applied to your own developments, but is done in a way which breaks down each element of the technology and the supporting iOS SDKs. Soon, you will be armed with all the tools and to produce interactive proximity-powered solutions with ease.

Finally, this book comes with an OS X app that lets you use your Mac as an iBeacon so that you can get to grips with the technology without having to buy any beacons.

What this book covers

Chapter 1, Welcome to iBeacon, introduces you to the technology and the incredible opportunities it offers us as developers. We'll cover the technological advancements that have made iBeacon possible and we'll discuss some of the options which you have to get your hands on for some real beacons. Finally, we'll create the age-old Hello World application and start detecting beacons easily.

Chapter 2, Detecting Beacons – Showing an Advert, introduces you to beacon detection in more detail. We'll show you how to differentiate between beacons using the values that they broadcast and we'll introduce the concept of regions and some of the CoreLocation classes used to represent regions and location. We will also cover the user permissions needed to monitor beacons before building a tutorial using our new-found knowledge to build an app that shows different offers as you approach different beacons.

Chapter 3, Broadcasting Advertisements – Sending Offers, introduces you to the important classes in the Core Bluetooth framework and discusses how to handle the variations in beacon broadcasting power before building a functioning beacon broadcasting app. Now that you know how to detect beacons and act on their unique broadcasting values, you will learn how to turn your iPhone or iPad into a fully functioning iBeacon broadcaster.

Chapter 4, Ranging Beacons – Hunting for Treasure, introduces the concept of ranging beacons and determining their distance from the receiver. This chapter expands on the CLLocationManager class usage and will take you through a tutorial that allows one device to be configured as a sender and another as a receiver to ultimately build a simple treasure-hunting app.

Chapter 5, Detecting Beacons in the Background – Location Dating, introduces you to the core responsibilities of the iOS in monitoring beacons in the background. We will discuss how iOS takes over beacon monitoring when the app is in the background and will also launch the app if it has been terminated.

Chapter 6, Leaving Regions – Don't Forget Your Stuff, discusses other uses of beacon technology and introduces functionalities based on when a user leaves a region. This chapter will introduce you to the possibilities of the technology for home automation before showing how to develop an application that ensures you don't leave your keys or wallet at home.

Chapter 7, Vendor SDKs – Buying and Configuring Beacons, discusses some popular vendor implementations of iBeacon hardware and takes you through some of the vendor software development kits to build a beacon configuration tool using the Estimote SDK, as buying iBeacon hardware can be difficult. By the end of this chapter, you'll be armed and confident to go and buy beacons for your commercial implementation.

Chapter 8, Advanced Tutorial – iBeacon Museum, pulls everything together with a more advanced tutorial. The tutorial focuses on an imaginary museum, which has different exhibits and multiple displays within each of the exhibits. As the user travels around the museum, the information shown in the app changes to show information about the display that they are currently closest to. As the user travels around the museum, you can track the user's journey on an interactive website.

Chapter 9, iBeacon Security – Understanding the Risks, arms you with a complete idea of the security vulnerabilities that need consideration when building apps that use iBeacon. This chapter also dispels any myths around security that concern users and discusses ways to naturally request the security permissions in an app without scaring users.

What you need for this book

For this book, you will be required to download Xcode on your Mac OS X machine.

In order to jump quickly into the tutorials, you will need to download the companion app, which allows your Mac machine to act as an iBeacon and contains all of the iBeacon profiles featured in the book.

Your Mac needs to have Bluetooth 4.0 (which most do), but if it doesn't, there's no need to worry, as you can pick up a Bluetooth 4.0 USB dongle for under $ 15, which will allow the companion app to work.

To see whether your Mac is Bluetooth 4.0 enabled, follow these steps:

  1. Click on the menu.

  2. Select About This Mac.

  3. Click on the More Info button.

  4. Click on the System Report button.

  5. Select Bluetooth from the sidebar on the left, underneath Hardware.

  6. Scan down the list of information until you find LMP Version.

  7. If your Mac is equipped with Bluetooth 4.0, LMP Version will say 0x6. Anything lower than that is an older version of Bluetooth and will need a USB dongle.

Who this book is for

This book is designed for new or experienced iOS developers who want to build solutions that interact with the world around them. The book doesn't require you to have any prior experience in developing apps using Xcode and iOS SDKs, but some familiarity would allow you to get going very quickly. The tutorials are designed to progressively build on your knowledge until you are armed with everything you need to build proximity-powered solutions.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "In order to do this, we need to add a reference to CoreLocation."

A block of code is set as follows:

-(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {
    UIAlertView * av = [[UIAlertView alloc] init];
    av.title = [NSString stringWithFormat:@"Entered Region '%@'", region.identifier];
    [av addButtonWithTitle:@"OK"];
    [av show];
}

Any command-line input or output is written as follows:

open Estimote\ Beacon\ Manager.xcworkspace/

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Select About This Mac."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Learning ibeacon
Published in: Nov 2014 Publisher: ISBN-13: 9781784397128
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}