Namespace: pwa

qui.pwa

Source:

Methods

(static) enableServiceWorker(urlopt, updateHandleropt)

Enable the service worker functionality.

Parameters:
Name Type Attributes Description
url String <optional>

URL at which the service worker lives; qui.config.navigationBasePrefix + "/service-worker.js" will be used by default

updateHandler function <optional>

a function to be called when the service worker is updated; should return a promise that will be used to control the activation of the new service worker

Source:

(static) setInstallHandlers(elementHandler, responseHandleropt, nullable)

Configures the handler functions for the app installation.

This must be called before qui.init.

Parameters:
Name Type Attributes Description
elementHandler qui.pwa.InstallElementHandler
responseHandler qui.pwa.InstallResponseHandler <optional>
<nullable>
Source:

(static) setupManifest(urlopt, displayNameopt, displayShortNameopt, descriptionopt, versionopt, themeColoropt, backgroundColoropt)

Setup the web app manifest.

Parameters:
Name Type Attributes Description
url String <optional>

the URL where the manifest file lives; qui.config.navigationBasePrefix + "/manifest.json" will be used if not specified

displayName String <optional>

an optional display name to append to the URL as a query argument (must be handled by the template rendering engine on the server side); defaults to qui.config.appDisplayName

displayShortName String <optional>

an optional short display name to append to the URL as a query argument (must be handled by the template rendering engine on the server side)

description String <optional>

an optional description to append to the URL as a query argument (must be handled by the template rendering engine on the server side)

version String <optional>

an optional version to append to the URL as a query argument (must be handled by the template rendering engine on the server side)

themeColor String <optional>

an optional theme color to append to the URL as a query argument (must be handled by the template rendering engine on the server side); defaults to @interactive-color

backgroundColor String <optional>

an optional background color to append to the URL as a query argument (must be handled by the template rendering engine on the server side); defaults to @background-color

Source:

Type Definitions

InstallElementHandler() → {Promise.<jQuery>}

A handler function responsible for providing a clickable element that prompts user for app installation.

Source:
Returns:

a promise that resolves to a clickable element that prompts for app installation upon click

Type
Promise.<jQuery>

InstallResponseHandler(accepted)

A handler function called after the user responds to installation prompt.

Parameters:
Name Type Description
accepted Boolean

indicates whether user accepted installation or not

Source: