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

// import { firebase } from 'https://www.gstatic.com/firebasejs/8.3.2/firebase-app.js'
// import { messaging } from 'https://www.gstatic.com/firebasejs/8.3.2/firebase-messaging.js'

firebase.initializeApp({
    apiKey: "AIzaSyB-C57QtBHq8Sm4CEE7CmPR9HZZc1lLcUY",
    projectId: "trading-fmcg-292b2",
    messagingSenderId: "209774616786",
    appId: "1:209774616786:web:48c52b1e14f8c57f234d0b",

});

const messaging = firebase.messaging();
messaging.setBackgroundMessageHandler(function({data:{title,body,icon}}) {
    return self.registration.showNotification(title,{body,icon});
});
