1
votes

I'd like to develop a PWA and push notifications are very important for the UX. I would want that notifications could be received from users even when the app (the browser, actually) is closed, just the way how push notifications work on native apps...i already know that i will need to use GCM, as well as a Service that "listens" for notifications and sends an intent if and when they are delivered. Can i achieve the same behaviour into browser, maybe using service workers?

Furthermore, i've tried a PWA demo for push notifications, from Google, and this is what it show.

Little notification widget

Native apps, such as whatsapp can show a different format of notification

Desired notification widget

Does it depend from a potential difference beetween browser and native app? can i customize notification widget format for PWAs? Is it indipendent from the installed browser?

Thanks in advance for the answers!

1
I think you can, you may want to check the documentation - Displaying a Notification also there is a sample page containing different notification display both for Web and Mobile. Hope this helps. - Mr.Rebot

1 Answers

2
votes

There is an online tool for testing and customizing notifications with all of the available options:

https://tests.peter.sh/notification-generator/

I tested it in Chrome, Opera, and Firefox on Android, and they all seem to have the same appearance. However some options may not be implemented in some browsers, yet. For example, on my device, Badge only works in Chrome. For other browsers standard browser logo is shown in Notifications bar.

Check the API reference for more details.