API: Check API Availability

Note: This is a deprecated feature, meaning that we no longer offer support for it.

This sample code allows you to determine when the JavaScript API is available if you are accessing the API by Injection. 

Note that accessing the API by Injection has been deprecated in version 10.0 and is not recommended for new projects as it may be removed in a later release.

Requirements

Kiosk Pro Basic, Plus and Enterprise

  • 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.
  • Offline Status
    • Unlike all other API examples we provide, the API Availability functions are only used when the JavaScript API is accessed by injection, which means that the files must be downloaded, unzipped, and transferred locally to the the device.
    • As functions are only available in the 'By Injection' method if the device is offline, the device must not be connected to the Internet.
  • App Settings
    • Homepage = deprecated-api-availability-api.html (with file stored locally)
    • JavaScript > Access JavaScript API = By Injection (Deprecated, Offline Only)


Notifications via API Callbacks

On App-Defined Variable Injection

This is a callback triggered by the app when all app-defined variables in the JavaScript API have been successfully loaded and are available for use.

Format
kp_Vars_DidInject();
		

Status

This callback does not return a specific value, but instead can be used to trigger other events that rely on the JavaScript API being available. This is done by defining this callback function in your code and placing a call within it.


On Function & Callback Injection

This callback is triggered by the app when all functions and callbacks that make up the JavaScript API have been successfully loaded and are available for use.

Format
kp_Hooks_DidInject();
		

Status

This callback does not return a specific value, but instead can be used to trigger other events that rely on the JavaScript API being available. This is done by defining this callback function in your code and placing a call within it.


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 download a .zip of sample code, click here.

Change Log

  • Added in version 3.4.1. Deprecated in version 10.0.

Related Articles

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