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

firebase.initializeApp({
  apiKey: "AIzaSyBNwjFEjDeP2IbMgHqbK5GBCiGHSIk10rQ",
  authDomain: "billing-92cbf.firebaseapp.com",
  databaseURL:
    "https://billing-92cbf-default-rtdb.asia-southeast1.firebasedatabase.app",
  projectId: "billing-92cbf",
  storageBucket: "billing-92cbf.firebasestorage.app",
  messagingSenderId: "26093709880",
  appId: "1:26093709880:web:0adbe005d6cd15de5314cd",
});

const messaging = firebase.messaging();

messaging.onBackgroundMessage((payload) => {
  const { title, body } = payload.notification;
  self.registration.showNotification(title, { body });
});
