1self.addEventListener('notificationclick', function(event) { 2 event.notification.close(); 3 event.waitUntil(async function () { 4 5 try { 6 const url = new URL(event.notification.data.FCM_MSG.data.link).toString(); 7 if (url) { 8 c = await clients.openWindow(url); 9 } 10 } catch(e) { 11 try { 12 let data = JSON.parse(event.notification.data); 13 const url = new URL(data.link).toString(); 14 if (url) { 15 c = await clients.openWindow(url); 16 } 17 } catch(e) { 18 console.error('Error al manejar el evento de clic en la notificación:', e); 19 } 20 } 21 22 23 }()); 24}); 25 26importScripts('https://www.gstatic.com/firebasejs/10.11.0/firebase-app-compat.js') 27importScripts('https://www.gstatic.com/firebasejs/10.11.0/firebase-messaging-compat.js') 28 29// Your web app's Firebase configuration 30// For Firebase JS SDK v7.20.0 and later, measurementId is optional 31const firebaseConfig = {"apiKey":"AIzaSyDZFJ6VePebiqmYh3_oMEt3GYUToXChr7s","authDomain":"enfoque-uno.firebaseapp.com","projectId":"enfoque-uno","storageBucket":"enfoque-uno.appspot.com","messagingSenderId":"505841143993","appId":"1:505841143993:web:6fe470c1372c2c67c98b68","measurementId":"G-F7NEXH3YKY"}; 32 33// Initialize Firebase 34const app = firebase.initializeApp(firebaseConfig); 35const messaging = firebase.messaging(); 36 37// Configuración opcional de mensajerÃa de Firebase 38messaging.onBackgroundMessage(function(payload) { 39 40 // Personaliza el manejo del mensaje recibido en segundo plano aquà 41 42 const notificationTitle = payload.data.title; 43 const notificationOptions = payload.data; 44 45}); 46 47 48 49/* version: v3-76 */
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.