I am trying to develop push notifications for my website (Angular). I am following the documentation available at comet chat pro. When I am trying to run this in browser using ng serve
I am getting below error:
( Error Occurred FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope (‘http://localhost:4200/firebase-cloud-messaging-push-scope’) with script (‘http://localhost:4200/firebase-messaging-sw.js’): A bad HTTP response code (404) was received when fetching the script. (messaging/failed-service-worker-registration) )
I downloaded firebase-messaging-sw.js available in github and placed in root folder under index.html. Still I am getting the above error. Can you please help me to solve this issue.