0
因此,我设法使用Google Project和Service Worker为Google Chrome实施了网络推送通知。自定义Web推送通知(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"}]
}));
});