简体   繁体   English

gcm推送通知,渐进式webapp

[英]gcm push notifications, progressive webapp

I followed the google documents to create a progressive webapp and I've just implemented push notifications, however whenever I close the app I don't get any notifications. 我按照google文档创建了一个渐进式Web应用程序,我刚刚实现了推送通知,但是每当我关闭该应用程序时,我都不会收到任何通知。

Other apps like whatsapp seem to be able to send those notifications is there a difference between native notifications and gcm push notifications from a progressive webapp? 其他应用程序,例如whatsapp似乎能够发送这些通知,本机通知和来自渐进式Webapp的gcm推送通知之间是否有区别?

There absolutely no difference between the two, the rendering part is the same, it just that native ones are the notifications that comes from a apk generated app and the other one is rendered using google chrome or any web browser that support the functionality. 两者之间绝对没有区别,呈现部分是相同的,只是本机通知是来自apk生成的应用程序的通知,另一通知是使用Google chrome或任何支持该功能的网络浏览器呈现的。

Beside the service worker with the help of manifest.json file will use the GCM ( Google Cloud Messaging) to send notifications to end users. manifest.json文件帮助下的服务人员旁边,将使用GCM(Google云消息传递)将通知发送给最终用户。

I worked and implemented such functionalities before, and I got my notification directly to the browser and my android phone as well, therefore I created a Github repo with nice documentation that simulate just that using Nodejs and simple web interface, please feel free to check I guess it holds what you seek : 之前我曾工作和实现过这样的功能,我也将通知直接发送到浏览器和Android手机,因此我创建了一个Github存储库,其中包含不错的文档,这些文档仅使用Node.js和简单的Web界面进行模拟,请随时检查我猜猜它拥有您想要的东西:

Link : https://github.com/houssem-yahiaoui/webpush-notification 链接: https : //github.com/houssem-yahiaoui/webpush-notification

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM