Locate API: iBeacon Navigation

iBeacon is a Bluetooth advertising protocol designed by Apple, with native support in iOS. Kiosk Pro’s iBeacon navigation integration allows you to display a specific piece of content based on the device’s proximity to an iBeacon. This allows you to create a location-aware interactive presentation.

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

  • Kiosk Pro Settings
    • 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'.
  • iBeacon Configuration
    • UUID = B9407F30-F5F8-466E-AFF9-25556B57FE6D
    • BeaconA
      • Major Value = 1
      • Minor Value = 10
    • BeaconB
      • Major Value = 1
      • Minor Value = 20
    • BeaconC
      • Major Value = 2
      • Minor Value = 30
  • 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-navigation

Download Sample Code


kp_iBeaconAPI_startMonitoringWithPath2SchemeFile

This function initiates monitoring for iBeacons and defines the filepath to the schema file that instructs the app how to respond to specific beacons.

Format
kp_iBeaconAPI_startMonitoringWithPath2SchemeFile(filepath);
		
Parameters
  • filepath = path to the schema file. If local, this path should be relative to the Kiosk Pro documents folder (rather than relative to the file calling the function). If remote, this should be the full URL.

Status

If Kiosk Pro is unable tp find or parse the .xml file, the app will immediately call kp_iBeaconAPI_didFailMonitoringWithError, passing more detail about the error as a parameter.


kp_iBeaconAPI_stopMonitoring

This function ends monitoring for iBeacons.

Format
kp_iBeaconAPI_stopMonitoring();
		

kp_iBeaconAPI_didEnterBeaconRegion

This callback is run each time the device enters a new iBeacon region defined in the current schema file.

Format
kp_iBeaconAPI_didEnterBeaconRegion(UUID, majorValue, minorValue, name);
		
Return values
  • UUID = UUID as a string.
  • majorValue = major value as a string.
  • minorValue = minor value as a string.
  • name = region name as a string.

kp_iBeaconAPI_didExitBeaconRegion

This callback is run each time the device exits an iBeacon region defined in the current schema file.

Format
kp_iBeaconAPI_didExitBeaconRegion(UUID, majorValue, minorValue, name);
		
Return values
  • UUID = UUID as a string.
  • majorValue = major value as a string.
  • minorValue = minor value as a string.
  • name = region name as a string.

kp_iBeaconAPI_didFailMonitoringWithError

This callback is run following an unsuccessful call to initiate monitoring using ' kp_iBeaconAPI_startMonitoringWithPath2SchemeFile'.

Format
kp_iBeaconAPI_didFailMonitoringWithError(error);
		
Return values
  • 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?