Trigger API: Delay Remote Update

This JavaScript API allows you to delay refresh of the homepage when a remote content or settings 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.

Callback

Related Settings

Requirements

  • Access JavaScript API
    • By Import - recommended, works both online & offline, requires inclusion of kiosk_functions.js prior to any of the following calls.
    • By Injection - only works offline, may not be available 'onload'.
  • Remote Settings Control
    • Enable = On
    • XML File Location = Set to your settings XML file
    • Update Period = At least 1 minute

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 http://www.kioskproapp.com/delay-refresh

kp_ContentUpdater_shouldSkipRefreshHomePageAfterContentUpdating

This callback is run each time Kiosk Pro checks for either Remote Update Settings or Remote Update Of Local Files 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 value which determines the type of content updating. Currently the following values are possible:
    • 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.

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