google gcm “raw_data” payload for desktop chrome 50 beta

余生颓废 提交于 2019-12-24 01:15:31

问题


I am trying to send a and read message payload using the google GCM mechanism. To send the data I am using the instructions found under "Web Push" in: https://developers.google.com/web/updates/2016/03/web-push-encryption?hl=en where it is instructed, that until full support by chrome is available, the payload can be sent using "raw_data" which needs to be base64 encripted.

to display the data I am ussing chorome 50Beta, since it is supposed to support payloads. but when the 'push' event is fired, the service-worker event.data is null.

Is there a live web example of chrome push messaging payload out there?


回答1:


You could use my web-push Node.js library. I've recently added support for Chrome 50.

I've just released the version 2 of the library with support for payloads on Chrome 50 and I've updated the ServiceWorker Cookbook to use it.

You can use the demos on that website (in particular the Push Payload one).



来源:https://stackoverflow.com/questions/36198038/google-gcm-raw-data-payload-for-desktop-chrome-50-beta

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!