Locate API: iBeacon Advertising

iBeacon is a Bluetooth advertising protocol designed by Apple, with native support in iOS. Kiosk Pro’s iBeacon advertising integration allows you to advertise your device as an iBeacon while also displaying content for visitor use. This makes it possible for the app to support contextual, location-aware experiences through another app on a visitor’s personal device or through Kiosk Pro on another iPad without requiring additional iBeacon hardware.

While this isn’t a great fit for a traditional kiosk where the device is in a fixed location, it is more useful for deployments where devices are distributed to visitors, like a multimedia tour of a museum.

Functions

Callbacks

Related Settings

Requirements

  • JavaScript API > Access JavaScript API
    • By Import - recommended, works both online & offline, requires inclusion of kiosk_functions.js prior to any of the following calls.
    • By Injection - only works offline, may not be available 'onload'.
  • iBeacons > Advertise Device as iBeacon
    • Advertise = On JavaScript API Call
    • UUID = C9CA99FB-69AF-4AE1-B72C-3E5A95E349D3 (default)
    • Major Value = 1 (default)
    • Minor Value = 1 (default)
  • Access to Location Services

Sample Code

This sample code relies on the JavaScript APIs built into Kiosk Pro and will not run successfully in other browsers or within our in-app help interface.  
To run sample code, set the app's homepage to http://www.kioskproapp.com/ibeacon-advertising

Download Sample Code


kp_iBeaconAPI_startAdvertising

This function initiates advertising for the device as an iBeacon.

Format
kp_iBeaconAPI_startAdvertising();
		

Status

If the call is successful, the app will immediately call kp_iBeaconAPI_didStartAdvertising. If the call fails, the app will immediately call kp_iBeaconAPI_didFailStartAdvertising.


kp_iBeaconAPI_stopAdvertising

This function ends advertising for the device as an iBeacon.

Format
kp_iBeaconAPI_stopAdvertising();
		

kp_iBeaconAPI_didStartAdvertising

This callback is triggered when the device successfully starts advertising as an iBeacon.

Format
kp_iBeaconAPI_didStartAdvertising(UUID, majorValue, minorValue,  identifier, sessionAlreadyInProgress);
		
Return values
  • UUID = UUID entered in Kiosk Pro settings as a string.
  • majorValue = major value entered in Kiosk Pro settings as a string.
  • minorValue = minor value entered in Kiosk Pro settings as a string.
  • identifier = identifier entered in Kiosk Pro settings as a string.
  • sessionAlreadyInProgress = integer defining if the device is already advertising. Possible values are:
    • 0 = false
    • 1 = true

kp_iBeaconAPI_didFailStartAdvertising

This callback is triggered when the device fails to start advertising as an iBeacon.

Format
kp_iBeaconAPI_didFailStartAdvertising(UUID, majorValue, minorValue, identifier, error);
		
Return values
  • UUID = UUID entered in Kiosk Pro settings as a string.
  • majorValue = major value entered in Kiosk Pro settings as a string.
  • minorValue = minor value entered in Kiosk Pro settings as a string.
  • identifier = identifier entered in Kiosk Pro settings as a string.
  • error = JavaScript object with the following properties:
    • error.code
    • error.description
    • error.failureReason
    • error.recoverySuggestion
    • error.debugDescription
    • error.domain

kp_iBeaconAPI_didStopAdvertising

This callback is triggered when the device stops advertising as an iBeacon.

Format
kp_iBeaconAPI_didStopAdvertising(UUID, majorValue, minorValue, identifier);
		
Return values
  • UUID = UUID entered in Kiosk Pro settings as a string.
  • majorValue = major value entered in Kiosk Pro settings as a string.
  • minorValue = minor value entered in Kiosk Pro settings as a string.
  • identifier = identifier entered in Kiosk Pro settings as a string.

kp_iBeaconAPI_didFailStopAdvertising

This callback is triggered when the device stops advertising as an iBeacon.

Format
kp_iBeaconAPI_didFailStopAdvertising(UUID, majorValue, minorValue, identifier, error);
		
Return values
  • UUID = UUID entered in Kiosk Pro settings as a string.
  • majorValue = major value entered in Kiosk Pro settings as a string.
  • minorValue = minor value entered in Kiosk Pro settings as a string.
  • identifier = identifier entered in Kiosk Pro settings as a string.
  • error = JavaScript object with the following properties:
    • error.code
    • error.description
    • error.failureReason
    • error.recoverySuggestion
    • error.debugDescription
    • error.domain

Still stuck? How can we help? How can we help?