是否可以从Firebase浏览器推送通知中删除“激活”按钮?
下面给出了我的代码,我没有添加“激活”或“设置”按钮。我仅添加了“立即答复”按钮。
var messaging = firebase.messaging();
self.addEventListener('notificationclick', function (event) {
// Notification click
if(event.action == 'reply_now')
{
clients.openWindow('http://www.example.com');
}
});
messaging.setBackgroundMessageHandler(function (payload) {
var noti = JSON.parse(payload.data.notification);
var notificationTitle = noti.title;
var notificationOptions = {
body: noti.body,
icon: 'https://www.gstatic.com/mobilesdk/160503_mobilesdk/logo/2x/firebase_28dp.png',
actions: [
{
action: 'reply_now',
title: 'Reply Now',
icon: 'https://www.gstatic.com/mobilesdk/160503_mobilesdk/logo/2x/firebase_28dp.png'
}
]
};
return self.registration.showNotification(notificationTitle, notificationOptions);
});