【发布时间】:2020-01-20 03:08:03
【问题描述】:
我在 Article = 的帮助下在我的应用程序中实现推送通知 https://medium.com/@arjenbrandenburgh/angulars-pwa-swpush-and-swupdate-15a7e5c154ac
我正在使用 Angular 版本 7 并使用来自 '@angular/service-worker' 的 => SwPush 在我的应用程序中推送通知。
要运行应用程序并在我的应用程序中查看推送通知功能,我使用了 2 个命令:
- ng build --prod
- http-server -p4100 -c-1 dist/my-pwa-app
当我打开 http://localhost:4100 或 http://127.0.0.1:4100 时,Service Worker 正在运行并且推送通知正在运行。
但是当我在浏览器中打开http://172.16.0.201:4100 时,应用程序中没有运行服务工作者 => 服务工作者
【问题讨论】:
标签: angular push-notification service-worker progressive-web-apps angular-pwa