API: Control & Trigger Fingerbot Button Press
Remotely trigger buttons and switches by connecting to a Fingerbot Bluetooth actuator. This functionality is great for kiosk deployments that need to physically trigger something using the iPad, or for home automation.
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
- JavaScript > Access JavaScript API > By Import
- iOS/iPadOS Permissions
- Bluetooth - more on enabling specific iOS/iPadOS permissions here
- Physical Hardware
- unencrypted Fingerbot device. More information about Fingerbot is available here, but the Fingerbots available for sale on the Adaprox site are encrypted and can not be used with Kiosk Pro. For information on ordering compatible Fingerbot devices directly from Kiosk Group, contact us directly.
Triggers via API Functions
- Scan for Fingerbot
- Stop Scanning for Fingerbot
- Get List of Connected Fingerbots
- Check if Fingerbot is Connected
- Update Fingerbot Firmware
- Connect to Fingerbot
- Disconnect from Fingerbot
- Send Click Request to Fingerbot
- Get Battery Level from Fingerbot
- Set Sustain Time on Fingerbot
- Set Down Movement on Fingerbot
Scan for Fingerbot
This function scans for Fingerbots.
Format | kp_FingerbotAPI_startScan(); |
Triggers | This call immediately triggers kp_FingerbotAPI_didUpdateScanningState. If the scan fails to find a new Fingerbot it will trigger kp_FingerbotAPI_didFailToDiscoverNewDevices. If the scan fails due to a Bluetooth connection problem it will trigger kp_FingerbotAPI_didFailToDiscoverDevicesDueToBluetoothProblems. |
Stop Scanning for Fingerbot
This function stops scanning for Fingerbots.
Format | kp_FingerbotAPI_stopScan(); |
Triggers | This call immediately triggers kp_FingerbotAPI_didUpdateScanningState. |
Get List of Connected Fingerbots
This function gets a list of Fingerbots that are currently connected.
Format | kp_FingerbotAPI_getAllConnectedDevices(); |
Triggers | This call immediately triggers kp_FingerbotAPI_didUpdateDeviceList. |
Check if Fingerbot is Connected
This function checks if a specific Fingerbot is connected.
Format | kp_FingerbotAPI_isDeviceConnected(deviceId); |
Parameters | |
Triggers | If the Fingerbot is connected, this call triggers kp_FingerbotAPI_didConnectToDevice. Otherwise, this call triggers kp_FingerbotAPI_didDisconnectFromDevice. If the device cannot be found then kp_FingerbotAPI_didFailFindDeviceWithId will be triggered. |
Update Fingerbot Firmware
This function updates the firmware on a specific Fingerbot. Note: calling this function disconnects the device, so you'll need to re-connect using kp_FingerbotAPI_connectToDevice after the update is finished.
Format | kp_FingerbotAPI_updateFirmwareVersionOnDevice(deviceId); |
Parameters | |
Triggers | This call immediately triggers kp_FingerbotAPI_disconnectFromDevice, unless Kiosk Pro fails to find the device, in which case kp_FingerbotAPI_didFailFindDeviceWithId will be triggered. After you re-connect the Fingerbot, the kp_FingerbotAPI_didUpdateFirmwareVersionOnDevice callback will trigger. |
Connect to Fingerbot
This function connects to a specific Fingerbot.
Format | kp_FingerbotAPI_connectToDevice(deviceId); |
Parameters | |
Triggers | When connected, this call triggers kp_FingerbotAPI_didConnectToDevice. If the Fingerbot could not be found, kp_FingerbotAPI_didFailFindDeviceWithId is triggered. If the firmware was updated, this call will trigger When Firmware is Updated. |
Disconnect from Fingerbot
This function disconnects from a specific Fingerbot.
Format | kp_FingerbotAPI_disconnectFromDevice(deviceId); |
Parameters | |
Triggers | When disconnected, this call triggers kp_FingerbotAPI_didDisconnectFromDevice. Otherwise, this call triggers kp_FingerbotAPI_didFailFindDeviceWithId. |
Send Click Request to Fingerbot
This function sends a click request to a specific Fingerbot.
Format | kp_FingerbotAPI_clickOnDevice(deviceId); |
Parameters | |
Triggers | This call trigger when the click request is successful. If the Fingerbot cannot be found, kp_FingerbotAPI_didFailFindDeviceWithId is triggered. |
Get Battery Level from Fingerbot
This function gets the battery percentage of a specific Fingerbot.
Format | kp_FingerbotAPI_refreshBatteryOnDevice(deviceId); |
Parameters | |
Triggers | This call triggers kp_FingerbotAPI_didRefreshBatteryOnDevice. If the Fingerbot cannot be found, kp_FingerbotAPI_didFailFindDeviceWithId is triggered. |
Set Sustain Time on Fingerbot
This function
Format | kp_FingerbotAPI_setSustainTimeOnDevice(deviceId, time); |
Parameters | |
Triggers | This call triggers kp_FingerbotAPI_didUpdateSustainTimeOnDevice. If the Fingerbot cannot be found, kp_FingerbotAPI_didFailFindDeviceWithId is triggered. |
Set Down Movement on Fingerbot
This function
Format | kp_FingerbotAPI_setDownMovementOnDevice(deviceId, percent); |
Parameters | |
Triggers | This call triggers kp_FingerbotAPI_didUpdateSustainTimeOnDevice. If the Fingerbot cannot be found, kp_FingerbotAPI_didFailFindDeviceWithId is triggered. |
Notifications via API Callbacks
- When Scanning Status Changes
- When Scanning Fails Due to Bluetooth
- When a Fingerbot Cannot be Found
- When the Fingerbot List is Updated
- When a Fingerbot with the Specified ID Cannot be Found
- When Firmware is Updated
- When Getting Battery Status is Successful
- When Fingerbot Charging Status Changes
- When Fingerbot is Connected
- When Fingerbot is Disconnected
- When Fingerbot is Clicked
- When Down Movement is Updated
- When Sustain Time is Updated
When Scanning Status Changes
This callback is triggered when the scan for Fingerbots starts or ends.
Format | kp_FingerbotAPI_didUpdateScanningState(isScanning); |
Return values | isScanning - [integer] the status of the scan. Possible values include:
|
When Scanning Fails Due to Bluetooth
This callback triggers if scanning fails because Bluetooth is turned off.
Format | kp_FingerbotAPI_didFailToDiscoverDevicesDueToBluetoothProblems(); |
When a Fingerbot Cannot be Found
This callback triggers when a scan fails to find new devices.
Format | kp_FingerbotAPI_didFailToDiscoverNewDevices(callback); |
When the Fingerbot List is Updated
This callback triggers when a Fingerbot is found after scanning.
Format | kp_FingerbotAPI_didUpdateDeviceList(deviceList); |
Return values |
|
When a Fingerbot with the Specified ID Cannot be Found
This callback triggers when trying to communicate with a specific Fingerbot fails.
Format | kp_FingerbotAPI_didFailFindDeviceWithId(callback); |
Return values | deviceId - [string] the Fingerbot identifier |
When Firmware is Updated
This callback triggers after connecting to a Fingerbot that had its firmware updated.
Format | kp_FingerbotAPI_didUpdateFirmwareVersionOnDevice(device, version); |
Return values |
|
When Getting Battery Status is Successful
This callback triggers when getting the battery status of a Fingerbot is successful.
Format | kp_FingerbotAPI_didRefreshBatteryOnDevice(device, level); |
Return values |
|
When Fingerbot Charging Status Changes
This callback triggers when the charging status of a connected Fingerbot changes.
Format | kp_FingerbotAPI_didUpdateChargingOnDevice(device, chargingStatus); |
Return values |
|
When Fingerbot is Connected
This callback triggers when a Fingerbot is connected.
Format | kp_FingerbotAPI_didConnectToDevice(device); |
Return values |
|
When Fingerbot is Disconnected
This callback is triggered when a Fingerbot is disconnected.
Format | kp_FingerbotAPI_didDisconnectFromDevice(device); |
Return values |
|
When Fingerbot is Clicked
This callback is triggered when a Fingerbot successfully receives a click request.
Format | kp_FingerbotAPI_didClickOnDevice(device); |
Return values |
|
When Down Movement is Updated
This callback triggers after the down movement of the Fingerbot is updated.
Format | kp_FingerbotAPI_didUpdateDownMovementOnDevice(device, percent); |
Return values |
|
When Sustain Time is Updated
This callback triggers after a Fingerbot's sustain time is updated.
Format | kp_FingerbotAPI_didUpdateSustainTimeOnDevice(device, time); |
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/fingerbot-api
- To download a .zip of sample code, click here.
Change Log
- Added in version 10.0.