Creating native Android push notifications for App built with PWA builder

1.3k views Asked by At

Successfully created an Android app of my PWA using PWA builder. Also Added web push notifications with the Service worker and web Firebase messaging API.

But due to certain shortcomings of web push notifications, I want to use the native push notifications using firebase SDK for Android instead.

Reading a few of these answers How to use push notification for trusted web activity, Cannot understand how to open a simple TWA inside an app (using AndroidX) gives me the impression that I need to have access to Main Activity and put Firebase onMessageReceived inside onCreate function.

But given PWA builder is a Node application that builds APK, I don't know where to start. I understand that I have to 1. Include the Firebase SDK & 2. Put onMessageReceived

But how to go about it using PWA builder?

Or Is it not possible at all? I need to create a brand new Andriod studio project and add TwaLauncher, from android-browser-helper as some of the answers mention?

Also posted this question on PWA builder issues.

1

There are 1 answers

3
MAZ On

When you are generating Android APK, enable the "Notification Delegation" option.

Push notification delegation option at PWA builder