Access API: What's Included

In this article

This portion of our JavaScript API allows you to access information about the device - specifically, to check if the JavaScript API is available to be called, to control your content based on the device’s orientation, to access the location coordinates of your device, and to access the Unique ID set in Kiosk Pro settings.

Check if the JavaScript API is available to be called

The custom JavaScript functions Kiosk Pro uses in its JavaScript API must be loaded before they can be called by your code. If you are accessing the JavaScript API by import as recommended, all functions will be loaded into the page prior to the ‘onload’ event and will thereafter be available at any time.

If you choose to access the JavaScript API by injection, it may not be fully loaded when the ‘onload’ event is triggered and in this case we recommend using these functions to determine when it is safe for your code to call an API function.

View Documentation & Sample Code

Determine which version of Kiosk Pro is being used

These API calls allow you to check which version of Kiosk Pro you are currently running, including the app name (for example, Kiosk Pro Plus) and the version number (for example, 6.8.1).  This information can be useful if you are deploying a new API call that may not be supported across all kiosks in your deployment or can be used for troubleshooting.

View Documentation & Sample Code

Access the Unique iPad ID and Group IDs set in Kiosk Pro settings

Kiosk Pro allows you to reference the Unique iPad ID set for your kiosk within Kiosk Pro settings by setting it as a JavaScript variable as the page is loading.

This lets you identify which kiosk is requesting a page or to tag form data with the ID of the sending kiosk. Checking for a unique ID can also provide a quick way of determining whether a visitor is accessing a site through Kiosk Pro (as opposed to a regular web browser).

To ensure that the ID variable is available when the ‘onload’ event is triggered, we recommend accessing the API by import. If you must access the API by injection, you will need to use the Availability API to determine when the function can safely be called.

View Documentation & Sample Code

Control your content based on the device’s orientation

This callback uses information sent from the device’s accelerometer to inform your code of the current orientation of the device. This is triggered automatically by the app on page load and after any change in the device’s orientation.

View Documentation & Sample Code

Access the location coordinates of your device

The location coordinates of the device can be set as a JavaScript array by the app as your page is loaded. Once defined, the array contains key-value pairs for latitude, longitude, accuracy, and a timestamp of when the reading was taken.

Coordinates are only available if the Kiosk Pro app setting Define Location Coordinates is set to On App Launch or Continuously and the app has been given permission to access Location Services, which must be turned on in iOS Settings > Privacy > Location Services. Once this setting is enabled, a special system alert will pop-up immediately after launch asking for permission to access Location Services. You must grant this permission for the app to be able to access and return location data.

If the app is set to Define Location Coordinates > Continuously, it will pull location data from the device once a minute and compares it to the previous location data. If a change in location is detected, Kiosk Pro supports a special callback to notify your page of that change.

View Documentation & Sample Code

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