-1

I am following the steps that are given in https://blog.angular-university.io/angular-push-notifications/#:~:text=Push%20Notification%20Demo,a%20Notification%20to%20the%20user.

I am trying to get push notification using angular. But while getting the push notification, I got an error

enter image description here

I have done the service worker setup. But don't know why this error is coming

swetha
  • 47
  • 1
  • 8
  • 4
    Does this answer your question? [Angular 6 - "Service workers are disabled or not supported" error](https://stackoverflow.com/questions/52513466/angular-6-service-workers-are-disabled-or-not-supported-error) – DGarvanski Jun 05 '20 at 07:12
  • yes working now.. But I am facing another issue now – swetha Jun 05 '20 at 07:56
  • I can see the push notification. if I close the push notification without clinking both allow and deny option, the localhost:8080 notification is blocked automatically. So I couldn't get the push notification again – swetha Jun 05 '20 at 07:58

1 Answers1

2

Service workers doesn't work with ng serve. use http-server like below :-

First install a http-server

npm i -g http-server

Build your project

ng build --prod

Inside dist run

http-server
Aakash Garg
  • 10,649
  • 2
  • 7
  • 25