Company
Date Published
Author
Michael Carroll
Word count
4680
Language
English
Hacker News points
None

Summary

This tutorial outlines how to use an iDevice as both an iBeacon emitter and observer using Swift for iOS and OS X, aimed at creating a system where shopkeepers can send daily deals to customers via an app. iBeacon, a Bluetooth protocol rather than a physical device, allows close-proximity information exchange, akin to a lighthouse guiding an observer. The tutorial details using PubNub to enhance iBeacon communication beyond basic data, enabling a device to act as the "brain" by subscribing to a channel to receive complex information and trigger events. The process involves setting up an ad server on the iBeacon-emitting device, broadcasting the beacon signal with defined major and minor numbers, and using CoreLocation and CoreBluetooth libraries for both emitter and observer devices. The observer, upon detecting the beacon, subscribes to the PubNub channel to receive ads or deals and can modify the communication model for various applications, such as location-based authentication. The tutorial also notes the release of a redesigned iOS SDK and provides guidance for migrating to the new version.