Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning ibeacon
  • Table Of Contents Toc
Learning ibeacon

Learning ibeacon

By : Craig Gilchrist
4.4 (7)
close
close
Learning ibeacon

Learning ibeacon

4.4 (7)
By: Craig Gilchrist

Overview of this book

This book is intended for iOS developers who are curious to learn about iBeacon and want to start building applications for iOS. You will gain everything you need to know to master indoor location functionality using Bluetooth beacon technology. No knowledge of iBeacon is assumed.
Table of Contents (11 chapters)
close
close
10
Index

Testing our code

Plug in an iOS device to your Mac, and compile and debug the app. You should be presented with a lovely blank white screen. Because we're using CoreLocation, you need to give permission for the app to use your location. It's important that you agree to this:

Testing our code

Location permission dialog

Now, open the companion app on your Mac and choose the beacon profile named Chapter 1 : Default Beacon from the list on the left-hand side and then click on the power button, as shown in the following screenshot:

Testing our code

Using your Mac to broadcast your first iBeacon

What you've just simulated is your device entering a region. If this was a real scenario, the beacon would have been running all along and your device would come into range because you walk towards the beacon, but the companion app serves just as well in this instance.

If all was successful, you should see the following screenshot:

Testing our code

Successfully entered the region

Finally, test exiting the region by turning the beacon profile off in the companion OS X app. It may take up to 30 seconds for the app to register that you've left the region. Once the event fires, you should see the following screenshot:

Testing our code

Successfully exited the region

Tip

The reason for the delay is that the didExitRegion method is meant for tidying up resources after ranging beacons, which we'll cover in the later chapters. Apple's implementation includes a delay to ensure the event isn't fired when the Bluetooth signal may be subject to interference.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning ibeacon
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon