API: Check Battery Status
- Sample code to run within the app and download for integration into your own project is available here.
- App Settings
Triggers via API Functions
Request Battery Status & Level
This function returns a callback detailing the current charging status of the device and the battery level.
|Parameters||callback - [string] the name of the callback to be triggered after the function has been executed|
|Callback return values||
Notifications via API Callbacks
On Battery Status Change
This callback is triggered when the battery status has changed. For example, when the device is plugged into AC power.
batteryStatus - [integer] the current charging status of the device. Possible options include:
On Battery Level Change
This callback is triggered when the battery level has changed.
batteryLevel - [float] current battery level of the device. Battery level ranges from 0.0 (fully discharged) to 1.0 (100% charged). If battery monitoring is not enabled or cannot be determined, the value of this property is –1.0.
- To run sample code, set the app's homepage to kioskgroup.com/battery-api
- To download a .zip of sample code, click here.
- Added in version 9.2