/* eslint-disable no-undef */
importScripts('https://www.gstatic.com/firebasejs/9.0.0/firebase-app-compat.js');
importScripts('https://www.gstatic.com/firebasejs/9.0.0/firebase-messaging-compat.js');

firebase.initializeApp({
  apiKey: "AIzaSyBciy2HXtKXxLXx5LC_onkEcd7KS3pgNIQ",
  authDomain: "notification-704bd.firebaseapp.com",
  projectId: "notification-704bd",
  storageBucket: "notification-704bd.firebasestorage.app",
  messagingSenderId: "188210057060",
  appId: "1:188210057060:web:f296ce213dc5e68457b471",
  measurementId: "G-FKJ9HKY1PH"
});

const messaging = firebase.messaging();

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