API: Advertise Device as iBeacon
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.
Note that Kiosk Pro can also trigger navigation or actions based on the presence of external iBeacons - more information on this functionality here.
Requirements
- Integration of our JavaScript API into your webpage
- Sample code to run within the app and download for integration into your own project is available here.
- Best practices for working with the JavaScript API are available here.
- App Settings
- Content > JavaScript API > Access JavaScript API = By Import
- Location > iBeacon > Advertise = On JavaScript API Call & UUID, Major Value, Minor Value configured
- iOS/iPadOS Permissions
- Bluetooth - more on enabling specific iOS/iPadOS permissions here
Triggers via API Functions
Start Advertising
This function initiates advertising for the device as an iBeacon using the identifiers configured in Kiosk Pro's settings.
Format | kp_iBeaconAPI_startAdvertising(); |
Triggers | 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. |
Stop Advertising
This function ends advertising for the device as an iBeacon.
Format | kp_iBeaconAPI_stopAdvertising(); |
Triggers | If the call is successful, the app will immediately call kp_iBeaconAPI_didStopAdvertising. If the call fails, the app will immediately call kp_iBeaconAPI_didFailStopAdvertising. |
Notifications via API Callbacks
On Advertising Start
This callback is triggered when the device successfully starts advertising as an iBeacon.
Format | kp_iBeaconAPI_didStartAdvertising(UUID, majorValue, minorValue, identifier, sessionAlreadyInProgress); |
Return values |
|
On Failure to Start Advertising
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 |
|
On Advertising Stop
This callback is triggered when the device stops advertising as an iBeacon.
Format | kp_iBeaconAPI_didStopAdvertising(UUID, majorValue, minorValue, identifier); |
Return values |
|
On Failure to Stop Advertising
This callback is triggered when the device is unable to stop advertising as an iBeacon.
Format | kp_iBeaconAPI_didFailStopAdvertising(UUID, majorValue, minorValue, identifier, error); |
Return values |
|
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 kioskgroup.com/ibeacon-advertising-api
- To download a .zip of sample code, click here.
Change Log
- Added in version 8.5