importScripts(
    "https://www.gstatic.com/firebasejs/9.7.0/firebase-app-compat.js",
);
importScripts(
    "https://www.gstatic.com/firebasejs/9.7.0/firebase-messaging-compat.js",
);

firebase.initializeApp({
    apiKey: "AIzaSyB9ImzI3ESfQk8mkgaWfmPd6b06djc6Toc",
    authDomain: "unibersereataurent.firebaseapp.com",
    projectId: "unibersereataurent",
    storageBucket: "unibersereataurent.appspot.com",
    messagingSenderId: "1001398873026",
    appId: "1:1001398873026:web:1564e433a45d57c38d845b",
    vapidKey: "BGDEauE5WfSMqA2Bi49wzOQyURiAe7-KP3e3VotUSgLmNk-mScvRhemqZ4mc26pVrwvFPLKVBsL35ikLcB3IvXk"
});
const messaging = firebase.messaging();

messaging.onBackgroundMessage((payload) => {
    console.log('Received background message ', payload);
    const notificationTitle = payload.notification.title;
    const notificationOptions = {
      body: payload.notification.body,
    };
  
    self.registration.showNotification(notificationTitle, notificationOptions);
});