API: Return Screen Orientation
This API 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.
In this article
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
Notifications via API Callbacks
On Screen Orientation Change or Page Load
This callback is triggered by the app on page load and after any change in the device's orientation.
Format | kp_Device_didRotateToOrientation(deviceOrientationInDegrees); |
Parameters |
|
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/screen-orientation-api
- To download a .zip of sample code, click here.
Change Log
- Added in version 5.4