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

var firebaseConfig = {
   apiKey: "AIzaSyD_H_wlzB7gwQYXe7gFg3RH_xZLaouz8HY",
    authDomain: "matrimony-project-88d35.firebaseapp.com",
    projectId: "matrimony-project-88d35",
    storageBucket: "matrimony-project-88d35.appspot.com",
    messagingSenderId: "480805593579",
    appId: "1:480805593579:web:10b7cd49de969a29e039ae",
    measurementId: "G-VG5P5W7HYC"
};

firebase.initializeApp(firebaseConfig);
const messaging=firebase.messaging();

messaging.setBackgroundMessageHandler(function (payload) {
    console.log(payload);
    const notification=JSON.parse(payload);
    const notificationOption={
        body:notification.body,
        icon:notification.icon
    };
    return self.registration.showNotification(payload.notification.title,notificationOption);
});