Angular 6 - “Service workers are disabled or not supported” error

后端 未结 2 2079
眼角桃花
眼角桃花 2021-01-17 20:24

I want to push notification subscription with web-push module and angular service worker. I\'ve followed instructions from these links: Angular Pus

2条回答
  •  长情又很酷
    2021-01-17 21:02

    Just set the service worker to work in dev environment also in 'AppModule'

    ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production})
    

    To

    ServiceWorkerModule.register('ngsw-worker.js', { enabled: true})
    

提交回复
热议问题