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"}]
}));
});