Android Status Bar Icon for Progressive Web App

1.3k views Asked by At

When a progressive web app (with service worker) shows a notification, the notification displayed in the notification drawer has the icon that I supply and looks fine.

However, when the drawer is closed, the status bar icon associated with that notification is specific to Chrome, shown here in the red circle. This happens whether viewed as a web page or when added to the home screen and running with display "standalone". enter image description here

Is there any way for a PWA to specify the icon that shows in the status bar?

1

There are 1 answers

1
Glen Little On

Turns out that the options for the showNotification method can have both icon and badge. The badge shows as the system icon, and the icon shows in the notification message.

Finding documentation for this is not easy, but https://notifications.spec.whatwg.org/ gave enough clues to figure this out.

Pointers to good (current) documentation about this would be appreciated!