I've written a progressive web app which plays music using the Web Audio API. A common user journey is to start the music playing, then change to other apps whilst still listening to the music. This works fine for a while, until android decides that it needs more resources for the other apps and closes down my PWA without warning.
Is there a way to hint to the browser and OS that despite not being in the foreground, the user is still using a particular web app? I'm fine for it to be tidied up in the background when the music is paused, but not whilst the user is still listening to something.
The main browser I'm interested in is Chrome for Android (though something platform agnostic would be ideal).
Using a service worker, a Progressive Web App (PWA) can do work in the background, even when the user isn't using the app. Service workers used to be reserved for native apps, but they are now also available to PWAs, providing a better offline experience.
To open Quick Settings, from the top of the screen, swipe down twice. To see the number of active apps running in the background: At the bottom left, tap # active apps. Or, at the bottom right, tap the number next to Settings and Power .
I have created a bug for this Chrome bug
If you have steps to reproduce, please comment on the bug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With