pwa-builder/CloudAPK

Creating native Android push notifications for App built with PWA builder

Closed this issue · 3 comments

Question in detail
How to add Andriod native push notifications? say using Firebase cloud Messaging SDK.

Is your question related to a problem? Please describe.
I understand that I have to 1. Include the Firebase SDK & 2. Put onMessageReceived inside main activity
But given PWA builder is a Node application that builds APK, I don't know where to start integrating.

Describe alternatives you've considered
I may have to create a brand new Andriod studio project and add TwaLauncher, from android-browser-helper as these answers mention?

Additional context
https://stackoverflow.com/questions/69148921/creating-native-andriod-push-notifications-for-app-built-with-pwa-builder

Hello ApurvH, thank you for your interest in PWABuilder!

I have automatically added a "needs triage" label to help get things started. Our team will look into the question and answer ASAP. Other community members may also answer the question and provide feedback 🙌

Hi folks, just following up since no response for 8 days.

Hi @apurvh

There might be some confusion here. PWABuilder helps you build web apps that you can publish into app stores. You're asking about native apps, which is something else.

To answer your question, you should implement push notifications just like you would any web app. Firebase can work with standard web push notifications.

Then, in PWABuilder, when you package your PWA for Android, make sure the following option is checked:

image

By checking Notification delegation, your Android app will automatically be approved for push notifications; no user permission needed.

Hope this helps.

p.s. For future reference, the best place to ask this question is on the main PWABuilder repo issues.