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; |
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 |
(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> |
(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; |
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 |
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 |
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 |
Type Definitions
InstallElementHandler() → {Promise.<jQuery>}
A handler function responsible for providing a clickable element that prompts user for app installation.
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 |