mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Improve tinymce autosave and notification web click solved
This commit is contained in:
@@ -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 });
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user