Google Beacon Platform

GBP_1

Google beacon platform consists of the following three components,

  1. Beacon device.
  2. Eddystone format.
  3. Proximity beacon API.

Beacon device

Beacon devices send one-way Bluetooth low energy(BLE) signals. These devices send data as Bluetooth beacon frames. With Eddystone, one beacon can send different frames in an interleaved fashion.

Eddystone format

Eddystone is an open beacon format developed by Google. The Eddystone specification defines several BLE frames as proximity beacon messages. Eddystone beacon works with both iOS and Android devices. In case of iOS device, the only limitation is that Eddystone works only when the application is in the foreground. So app suggestion or region monitoring features will not work with the Eddystone beacon. Although an app can be made to work with both iBeacon and Eddystone using features of the both beacon formats.

Eddystone frame types

Eddystone supports three types of frame

  1. Eddystone-UID

    This packet type is used for the identification of the beacon, composed of 10 bytes namespace and 6 bytes instance. Namespace can be used to identify a class of beacon and instance can be used to identify individual beacons in a class.

  2. Eddystone-URL

    This packet contains an URL. This way the Eddystone device can push contextual URLs to the client. The client can choose to perform different actions with these URLs. So for this capability, beacons can be used to implement a physical web.

  3. Eddystone-TLM

    These packets are used to broadcast various telemetry information about the beacon itself such as battery voltage, device temperature, and counts of broadcast packets.

Proximity Beacon API

Google Proximity beacon API is a cloud service which provides additional capabilities. The Proximity Beacon API allows the admin app to register beacons and add attachments (are very small arbitrary data) specific to one beacon or a set of beacons. Attachments can be up to 1024 byte long. When a particular beacon or a set of beacons are detected by the user end mobile app, the attachment can be served to the app by preferably Nearby API. Attachments received by an app will appear as individual messages but not grouped by beacon to the user`s mobile. Nearby messages also de-duplicate attachments.

The admin app can also delete, list attachments associated with beacons.

Diagnostic component of the Proximity Beacon API is used to monitor the health of the registered beacon.

Nearby API

Nearby API is a publish-subscribe API, that lets you pass small binary payloads between internet connected devices. Nearby uses a combination of Bluetooth, BLE, Wi-Fi and an ultrasonic modem to communicate a unique-in-time pairing code between devices. The server facilitates the message exchange between devices that detect the same pairing code. In case of beacons, the user mobile app gets the attachments when a particular beacon is detected as Nearby messages.

Example Use Case of Beacons and Attachments

A retail store can have multiple sections in multiple floors. The store can deploy beacons for each floor with multiple attachments and for each sections with multiple attachments. The user`s mobile will get de-duplicated messages illustrated below,

GBP_2

Brief Steps of Implementation

An organisation implementing the beacon infrastructure needs,

  1. Beacon devices.
  2. An Admin app used by the organisation.
  3. Mobile app used by the customers of the organisation.
  4. API infrastructure of Google.

Create project at console.developers.google.com

  1. Create a project.
  2. Add and enable APIS (Proximity Beacon API, Google Maps SDK for iOS, Google Places API for iOS) in the APIs and auth section.
  3. Generate OAuth 2.0 client id for each client app(including the admin app). The clients need to call the APIs with proper OAuth token in the Authorization Header of the HTTP requests.

Beacon Management By Admin App

To use a beacon, you have to register it with Google Beacon Registry using proximity API. Beacons are registered with their advertised ID. The JSON representation of advertised ID consists of type of beacon (EDDYSTONE, IBEACON, ALTBEACON) and actual id of the beacon(represented as Base64 string). Also you can associate a place id (a unique id that identifies a place in Google places database and map) with the beacon while registering.

GBP_3

Google Beacon Registry generates a beacon name(in this case “beacons/3! 1b4cba0cdfc24d7385b7952305398286”) and returns the JSON beacon structure.

GBP_4

Admin app performs several other beacon management jobs like e.g. activate a beacon(a user can observe the beacon), deactivate a beacon(no user can observe the beacon), update a beacon and decommission a beacon, using separate proximity APIs.

Attachment Management By Admin App

Admin app creates attachment using proximity API, say for the beacon named “beacons/3! 1b4cba0cdfc24d7385b7952305398286” by sending the following request. The `namespacedType` is of the form {namespaceName}/{Type} where `namespaceName` is fixed for a project, can be queried by a separate request to the server, please check the documentation. {Type} can be any string, depending upon the business logic.

GBP_5

Server returns an attachment with a name (“beacons/ 3!1b4cba0cdfc24d7385b7952305398286/ attachments/ 55a4a9a4-1d5f-470a-b9d5-8555d1a1851b”) assigned to it.Google Beacon Platform code-4

Admin app can also lists, deletes attachments by using separate proximity APIs.

Beacon Detection By Mobile App

To use the Nearby Messages APIs,

  1. Add Nearby Messages API to the beacon project created at earlier stage at console.developers.google.com
  2. Generate an API for iOS Devices
  3. Install the API in your iOS mobile project using CocoaPods.

References

    Google Beacon Platform
    Proximity Beacon API
    Nearby Messages API
    Code Samples By Google

Author: Sujal Ghosh