API: Delay Refresh After Remote Update

This JavaScript API allows you to delay a refresh of the homepage when a remote update is downloaded and would otherwise be applied immediately.

This API is based on the use of a special JavaScript callback. Kiosk Pro runs this callback after an appropriate update event occurs, but before updating the user interface.

Requirements

Kiosk Pro 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.
  • App Settings
    • Content > JavaScript API > Access JavaScript API = By Import
    • Remote Settings Control and/or Remote Update of Local Files = configured

Notifications via API Callbacks

Delay Homepage Refresh After Settings or Content Update

This callback is run any time Kiosk Pro checks for a Remote Settings Control or Remote Update Of Local Files update and finds a new update. The callback defines the specific event that has triggered the update, allowing you to define whether to allow or prevent the update based on the triggering event.

Generally when the app finds new content or settings, it will check for user interaction with the device and if no interaction is seen, will refresh the homepage to apply the update. If this callback is used to prevent application of the update, the app will still download the new content and/or settings, but will delay applying them until the app returns to the homepage.

Note: If no new settings or content are found during a check, Kiosk Pro will not attempt to refresh the homepage or engage this callback.

Format
kp_ContentUpdater_shouldSkipRefreshHomePageAfterContentUpdating(updateReason);
		
Parameters
  • updateReason = [integer] determines the type of content updating. Possible values are:
    • 0 = remote update of settings
    • 1 = remote update of local files
Defining the results To control whether the update is applied, you must define this callback in your code and set it to return the appropriate value when it is called.

If the function returns: 'yes' (case does not matter) or true or 1, then Kiosk Pro will skip refresh of the homepage. If something else is returned (or if the function is not defined), Kiosk Pro will refresh the homepage to display new content and/or settings as it normally would.


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 https://kioskgroup.com/delay-refresh-api
  • To download a .zip of sample code, click here.

Change Log

  • Added in 3.5.2 version.

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