【发布时间】:2016-09-15 10:10:20
【问题描述】:
所以我设法使用 Google Project 和 Service Worker 为 Google Chrome 实现了网络推送通知。
我的问题是如何自定义或装饰推送通知,因为消息框很简单。相反,我想用 html 和 css 来装饰它。
self.addEventListener('push', function(event) {
console.log('Push message received', event);
var title = 'Push message';
event.waitUntil(
self.registration.showNotification(title, {
body: 'Please choose to like or reply
icon: 'images/icon.png',
tag: 'my-tag',
actions:[
{action:"like", title: "Like"},
{action:"reply", title: "⤻ Reply"}]
}));
});
【问题讨论】:
标签: javascript html css google-chrome push-notification