2
main.556f577fa36f161b.js:1 Unable to get permission to notify. FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('https://website/firebase-cloud-messaging-push-scope') with the script ('https://website/firebase-messaging-sw.js'): A bad HTTP response code (404) was received when fetching the script. (messaging/failed-service-worker-registration).
I am getting this error. it's working fine locally. but after deployment, my address is https://website/project_name  so it is unable to find firebase-messaging-sw.js I have tried many ways.
I have followed this tutorial-

https://medium.com/mighty-ghost-hack/angular-8-firebase-cloud-messaging-push-notifications-cc80d9b36f82

I register these files in angular.json

"src/project_name/firebase-messaging-sw.js", "src/project_name/manifest.json",

like this and deploy locally it works for me but when I deploy it on the main server it doesn't work
Asmita Patil
  • 23
  • 1
  • 3

0 Answers0