Improve tinymce autosave and notification web click solved

This commit is contained in:
Eudes Inácio
2023-08-08 15:40:10 +01:00
parent 5cf48c1b2f
commit bf89e46841
10 changed files with 109 additions and 63 deletions
+13 -1
View File
@@ -19,7 +19,7 @@ firebase.initializeApp(firebaseConfig);
const messaging = firebase.messaging();
messaging.onBackgroundMessage(function(payload) {
console.log('Received background message ', payload);
console.log('Received background message 22 ', payload);
const notificationTitle = payload.notification.title;
const notificationOptions = {
@@ -57,4 +57,16 @@ self.addEventListener('message', function(event){
self.userID = data.uid;
self.userToken = data.token;
});
self.addEventListener('notificationclick', function(event) {
console.log("Push Clicked ", event);
// Enviar uma mensagem para o cliente (componente)
self.clients.matchAll().then((clients) => {
if (clients && clients.length) {
clients.forEach((client) => {
client.postMessage({ notificationClicked: true });
});
}
});
});