google gcm" raw_data"桌面chrome 50 beta的有效载荷 [英] google gcm "raw_data" payload for desktop chrome 50 beta

查看:153
本文介绍了google gcm" raw_data"桌面chrome 50 beta的有效载荷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用google GCM机制发送和读取消息有效内容。
要发送数据,我使用的是Web推送中的说明:
https://developers.google.com/web/updates/2016/03/web-push-encryption?hl=zh_CN
其中它被指示,直到完全支持通过铬可用,有效载荷可以发送使用raw_data,需要base64 encripted。



来显示我的数据使用chorome 50Beta,因为它应该支持有效载荷。
,但是当'push'事件被触发时,service-worker event.data为null。

是否有一个Chrome推送消息有效载荷在那里?

解决方案

您可以使用我的 web-push Node.js库。我最近添加了对Chrome 50的支持。



我刚刚发布了支持Chrome 50上的有效载荷的库版本2,并且我更新了<一个href =https://serviceworke.rs/ =nofollow> ServiceWorker Cookbook 可以使用它。



您可以使用演示该网站(特别是推送Payload )。


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?

解决方案

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).

这篇关于google gcm&quot; raw_data&quot;桌面chrome 50 beta的有效载荷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆