1importScripts( 2 "https://www.gstatic.com/firebasejs/9.14.0/firebase-app-compat.js" 3); 4importScripts( 5 "https://www.gstatic.com/firebasejs/9.14.0/firebase-messaging-compat.js" 6); 7 8const firebaseConfig = { 9 apiKey: "AIzaSyBf5VtWSb04dOaFYZ1HPaZY7hOzzMN8PO0", 10 authDomain: "officeapp-mspress-frontend.firebaseapp.com", 11 projectId: "officeapp-mspress-frontend", 12 storageBucket: "officeapp-mspress-frontend.appspot.com", 13 messagingSenderId: "945680352701", 14 appId: "1:945680352701:web:c1962f1620b20b9e393ed4", 15 measurementId: "G-R60CZQEEZ2", 16}; 17 18const app = firebase.initializeApp(firebaseConfig); 19 20//We don`t send data notification instead we send data message from backend 21 22firebase.messaging().onBackgroundMessage((payload) => { 23 console.log( 24 "[firebase-messaging-sw.js] Received background message ", 25 payload 26 ); 27 28 console.log("payload.notification", payload.notification); 29 console.log("payload.data", payload.data); 30 31 // Customize notification here 32 const notificationTitle = payload.data.title; 33 const notificationOptions = { 34 body: payload.data.body, 35 icon: payload.data.icon, 36 image: payload.data.image, 37 }; 38 39 self.registration.showNotification(notificationTitle, notificationOptions); 40 41 self.addEventListener("notificationclick", function (event) { 42 const clickedNotification = event.notification; 43 clickedNotification.close(); 44 45 event.waitUntil(clients.openWindow(payload.data.click_action)); 46 }); 47});
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.