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.
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.
const displayMode = apex.pwa.getDisplayMode();
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.
const installText = await apex.pwa.getInstallText();
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.
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 for the current user agent.
This function is automatically invoked when clicking on any DOM element with the following class:
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.