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

const firebaseConfig = {
  apiKey: "AIzaSyBLCzBOK4sp3qbjnAOVnKbn0UjV9ZWuDKM",
  authDomain: "alwesam-a0ce8.firebaseapp.com",
  databaseURL: "https://alwesam-a0ce8.firebaseio.com",
  projectId: "alwesam-a0ce8",
  storageBucket: "alwesam-a0ce8.appspot.com",
  messagingSenderId: "756232656584",
  appId: "1:756232656584:web:36628744da2b1a98cdb7fd",
  measurementId: "G-B8RQKV4L6L"
};

  firebase.initializeApp(firebaseConfig);

const messaging = firebase.messaging();
messaging.setBackgroundMessageHandler(function(payload) {
  console.log('[firebase-messaging-sw.js] Received background message ', payload);
  // Customize notification here
  const notificationTitle = payload.data.title;
  const notificationOptions = {
    body: payload.data.body,
	icon: 'fcm-push/img/icon.png',
	image: 'fcm-push/img/d.png'
  };

  return self.registration.showNotification(notificationTitle,
      notificationOptions);
});
// [END background_handler]