Skip to Main Content

Namespace: pwa

QuickNav

apex.pwa

The apex.pwa namespace contains Oracle APEX functions related to Progressive Web App features.

These functions are useful only when an APEX application has enabled Progressive Web App in the application definition.

Since:
  • 21.2

Functions

(static) getDisplayMode() → {string}

Get the current display mode for the Progressive Web App.

Possible values are: fullscreen, standalone, minimal-ui, browser.

The display mode is set by the developer in the application definition.

This function is used to determine if the application is currently accessed through the PWA application (eg. in fullscreen) or through the browser normally.

Returns:
Current display mode for the Progressive Web App
Type
string
Example

Returns the Progressive Web App current display mode. Possible values are: fullscreen, standalone, minimal-ui, browser.

const displayMode = apex.pwa.getDisplayMode();

(static) getInstallText() → {promise}

Returns the installation instruction text based on current user agent

Wheter the installability criteria are met or not, we provide helpful installation text to guide users to install their Progressive Web App.

Returns:
A Promise containing the installation instructions text
Type
promise
Example

Returns the text for the instructions for installing the Progressive Web App.

const installText = await apex.pwa.getInstallText();

(static) isInstallable() → {promise}

Determines if the current session is eligible for installation of the Progressive Web App.

This function will look at:

  • the user's operating system (Apple, Android, Window, macOS, etc).
  • the user's browser (Chrome, Safari, Edge, Firefox, etc).

Given the user's current setup, this function will determine if installing the Progressive Web App is possible.

Returns:
A Promise returning a boolean (true or false), based on installation eligibility
Type
promise
Example

Returns if the APEX application is installable as a Progressive Web App..

const isInstallable = await apex.pwa.isInstallable();

(static) openInstallDialog()

For browsers with automatic PWA installation, this function triggers the installation process.

For browsers without automatic PWA installation, this function opens a dialog with the instruction text for the current user agent.

This function is automatically invoked when clicking on any DOM element with the following class: .a-pwaInstall.

For example when creating a new APEX application with PWA enabled, a navigation bar entry is added with the .a-pwaInstall class. Developers can add custom buttons to their application and use the .a-pwaInstall class to trigger the Progressive Web App installation process.

Alternatively, developers can run this function to trigger the PWA installation process programatically for a custom experience.

Example

Opens the installation dialog for installing the Progressive Web App.

apex.pwa.openInstallDialog();