0
プッシュ通知を送信しようとするとOpera Desktop Browser 47の問題に直面しています。Opera Push Notification - notificationclickイベントを起動できません
通知が正しく配信されている間、私は 'notificationclick'イベントを引き起こすことができません。コンソールには何もありません。
サービスワーカー:(サンプルテストデータとSWスニペット)今
self.addEventListener('push', function(event) {
event.waitUntil(self.registration.pushManager.getSubscription().then(function(o) {
if (event.data) {
console.log(event.data);
var json=event.data.json();
var notifs = [];
const title = 'Sample Opera Title';
const options = {
body: 'Body of push notification',
};
payload_notifs.push(self.registration.showNotification(title, options));
return Promise.all(notifs);
}
}));
});
self.onnotificationclick = function(event) {
console.log('On notification click: ', event.notification.tag);
event.notification.close();
};
私は(イベントが完了せない)通知を送信した後にブレークポイントを入れていたときに、事があり、通知「notificationclick」イベントも機能しています。
これは、同じサービスコードを持つ他のブラウザで問題なく動作しているため、実際は非常に奇妙です。
アイデアはありますか?