Making an iBeacon App

First things first

Beacon technology provides location data much like GPS. But beacons are not a replacement for GPS technology. While the actual workings of the two technologies vary drastically, the end result is similar. The main selling point of beacons is their ability to provide a user’s location at a more granular level and in areas that GPS can’t reach. iBeacon apps actually benefit greatly from integrating GPS functionality, more on that later.
I recently finished working on “The Manifest Experience”, an iBeacon app for the digital agency I work at. The app’s purpose centers around welcoming guests to our office. It also gives them access to location specific details about our space. We built the app as a way to explore the technology and become more familiar with it’s strengths and weaknesses. During the development process I was able to freely experiment with iBeacons. We experimented with new ways to utilize the technology and ended up providing a pretty unique end-user experience. You can find the app on the AppStore here:

NOTE: I’m linking to provide additional context, no need to download it. The app isn’t useful to people that aren’t around our STL office.

Quick Look into The Manifest Experience

After downloading the app, the user enters some basic information, setting up a small profile of sorts. When a user walks into the office, the app detects the iBeacon at the entrance. The app then sends the users name and photo up to a web service. That web service backs a webpage displayed on a large video screen in the office. When the web service updates, the webpage displays a personalized welcome screen to the user. The welcome feature is most obvious use of iBeacon technology in the app, but not the only use. The app segments descriptions and pictures of each space into rooms. Each room section is initially locked until the app encounters the corresponding iBeacon for the first time. The app also allows users to post short messages straight up to the video wall while they are in the space. Effectively turning the office’s video screen into a sort of personal internal-office Twitter feed. I ran into quite a few hurdles during the development of the app. This technology is still relatively new. It can be difficult to find answers online to problems encountered during development. I’ve decided to share some of the learnings that came out of the whole process.

Utilizing iBeacon Data in an App

Local Notifications

Most people only think of location specific notifications when it comes to iBeacon apps. These local notifications are just the tip of the iceberg.

I find these sort of notifications are easy to overuse and abuse leading to an annoying user experience. We decided to stay away from them almost altogether in the app. The app only sends two notifications to users through out their entire experience. Once on their first visit to Manifest’s office to welcome them. The other is sent to thank them for visiting after they have left for the first time.

It’s rather easy to setup notifications to trigger when an app encounters an iBeacon. Apple’s CLBeacon model, is what apps use to represent an iBeacon. CLBeacon has a notification property built right into it, allowing for easy notification triggering.

Monitoring vs. Ranging

Apps receive iBeacon location data by registering for monitoring and/or ranging. The first time an iBeacon app opens it registers with the iPhone to “Monitor” for specific iBeacons. The app is then notified each time the iPhone enters or leaves that iBeacon’s region. Depending on the app’s location permissions, these events can be sent to the app even if it is not open.

Ranging can only happen when the app is active. With ranging on the app has access to the estimated distance between the iPhone each beacon it is in range of. This is the real power of iBeacons. With ranging on it’s possible to know a user’s location down to the foot. You can triangulate their position using the distance from multiple beacons in an area. While ranging is useful it is also very battery intensive, so it should be used sparingly. If over-used, the battery drain could cause the user to completely turn off location services for the app. This should be avoided as a permissions denial would render most location apps useless.

In the Manifest app we avoid iBeacon ranging altogether. Instead we rely on the much more battery efficient monitoring. The app records and saves the latest time and date of each iBeacon region’s entry and exit event. By saving region event timestamps the app can compare entry and exit events to see which is the latest. If they’re entry event is more recent than their exit event then we know they are currently in that region. The app saves the timestamps to the device as soon as the event occurs. Even if the app isn’t open when an event happens it is still recorded and available for reference later on.

iBeacon Weaknesses

iBeacon technology like everything else, has it’s faults. An iPhone, iPad or even a mac computer can be configured to imitate any iBeacon. Someone could easily fool an app into thinking they’re in an area when they aren’t. Luckily you can detect this trick using GPS monitoring. Just check the iPhone’s GPS position when an iBeacon related location event triggers. This will ensure that the iPhone is in the general area of the iBeacon, meaning ing the event is valid.

The iPhone will also occasionally lose an iBeacon’s signal while still in range. This triggers subsequent false exit and re-entry events. The iPhone delays exit events in an attempt to avoid this issue but false exits do still happen.