importScripts('https://www.gstatic.com/firebasejs/11.1.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/11.1.0/firebase-messaging.js');

firebase.initializeApp({
    apiKey: "AIzaSyAD3ExPvMsOLeG8LvDhXQ6j1qbH7k71y38",
    authDomain: "solid-erp-287513.firebaseapp.com",
    projectId: "solid-erp-287513",
    storageBucket: "solid-erp-287513.appspot.com",
    messagingSenderId: "105457319945",
    appId: "1:105457319945:web:175c69075f706ac98a38d8"
});

const messaging = firebase.messaging();

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