This may however have adverse effects on the existing flutter_service_worker.js.
In future, a better solution may be to incorporate the custom service worker code into the predefined and 'hardcoded' flutter_service_worker.js file (generated on flutter build web) via a Makefile script as suggested here via github actions and/or with an Makefile example here
Upon a page refresh (soft) via direct or indirect, notifications will stop working due to the page controller being reassigned (i.e. null).
A solution provided https://github.com/mswjs/msw/issues/98#issuecomment-612118211 suggests unregistering all registrations, then attempting to re-register.
This may however have adverse effects on the existing
flutter_service_worker.js
.In future, a better solution may be to incorporate the custom service worker code into the predefined and 'hardcoded'
flutter_service_worker.js
file (generated onflutter build web
) via aMakefile
script as suggested here via github actions and/or with an Makefile example here