Skip to main content

Command Palette

Search for a command to run...

APEX PWA Push Notifications in just a few minutes

Updated
APEX PWA Push Notifications in just a few minutes
R

Rodrigo is a Senior Oracle Developer at QV Systems. He is an experienced software engineer with emphasis in analysis, design and development of bespoke Oracle applications utilising development tools such as APEX, PL / SQL, jQuery, javaScript, CSS and JSON for a variety of international businesses. Rodrigo speaks regularly at Oracle community events and enjoys creating APEX plugins and writing blogs.

APEX 23.1 has just become available on apex.oracle.com, and one of its great features is the declarative push notifications for PWA apps. We can now enable push notifications without any further installation, simply by enabling them within an app.

What is PWA?

Progressive Web Apps (PWAs) are web applications that utilize modern web technologies to deliver an app-like experience to users. PWAs are installable, work offline, and have other features that enhance user experience, such as push notifications.

What are Push Notifications?

Push notifications are messages sent to users even when the app is not open or active. These notifications help increase user engagement and provide timely updates.

Now let's create app!

  1. On APEX page designer click on create and select new application.

  2. Make sure to check Install Progressive Web App and Push Notifications

That will create a new app and the first thing to notice is the settings menu item on the navigation bar

When we click that a drawer modal dialog page opens with the following option

Push notifications need to be enabled by each user. It works like that to respect user privacy and preferences. By explicitly enabling push notifications, users grant the application permission to send them notifications. This ensures that users have control over the information they receive and can opt-out if they feel overwhelmed or uninterested.

  1. Create a page process to send the notification. I am going to send this notification to a user called DEMO.

  1. Create a Button to submit the page and call the process we just created.

  2. The application is ready to send notifications. We only need to install it on the phone. To do so, open the application on your preferred browser (refer to the browser compatibility list below) and click on the Install app link in the navigation bar after logging in. (Make sure you log in with the same user from the application process) Follow the instructions provided to complete the installation process.

    1. Now let's enable push notifications for the logged user.

      1. If we click the button that we created in Step 4, it will initiate the page process and send the notification. Although it may take a few seconds to arrive, it works perfectly. I have tested on both Android and iOS, but for iOS, I need to upgrade my phone as the notifications only work on version 16.4.1 or higher.

We can also send the notifications using a new apex_pwa API.

begin
    apex_pwa.send_push_notification (
    p_application_id => 112046,
    p_user_name      => 'DEMO',
    p_title          => 'My APEX APP Notification',
    p_body           => 'Testing the Push Notifications' );
end;
A

Hi Rodrigo, when I send a push notification, my App link appears at the end. Is it possible to hide this information or change it to an alias for example the name I gave to this Application?

R

Hi Apostolos, You can specify the URL by adding p_target_url to the apex_pwa.send_push_notification.

1
A

Rodrigo Mesquita Thanks for your reply, I'm trying to use p_target_url but I still get the url path of my app. Is it possible to replace it with an alias?

G

This article didn’t described how identified by user on Oracle PWA client side service worker ? please let me more, If i user customer authentication, How i can do this thanks advance

R

Hi Angel, It usually take a few minutes to arrive. Are you using IOS? If yes, make sure the version is 16.4.1 or above.

A

No consigo que llegue la notificación , lo sigo todo paso por paso pero me da todo correcto pero nunca llega , tengo todas las notificaciones activadas

More from this blog

A

APEX Blog

33 posts