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.
- Since:
- 21.2
Get the current display mode for the PWA.
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:
- Type
- string
Example
const displayMode = apex.pwa.getDisplayMode();
- Deprecated:
- Yes
Returns:
- Type
- Promise
Determines if the current session is eligible for installation of the PWA.
This function will detect:
- the user's browser install prompt is available.
- the PWA is already installed on the user's device.
- the user session is currently in PWA mode.
- the user is on iOS/iPadOS on Safari.
Given the user's current device and browser, this function will determine if installing the PWA is possible.
Returns:
- Type
- Promise
Example
const isInstallable = await apex.pwa.isInstallable();
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.
This function is automatically invoked when clicking on any DOM element with the following class:
.a-pwaInstall
.
This function is also invoked on apex.actions
with action name
a-pwa-install
.
For example when creating a new APEX application with PWA enabled, a navigation bar entry is added with the
.a-pwaInstall
class and
href="#action$a-pwa-install"
.
Developers can add custom buttons to their application and use the
.a-pwaInstall
class or
href="#action$a-pwa-install"
to trigger the PWA installation process.
Alternatively, developers can run this function to trigger the PWA installation process programatically for a custom experience.
Example
apex.pwa.openInstallDialog();