|
importScripts('https://www.gstatic.com/firebasejs/8.10.1/firebase-app.js');
|
|
importScripts('https://www.gstatic.com/firebasejs/8.10.1/firebase-messaging.js');
|
|
|
|
firebase.initializeApp({
|
|
apiKey: "AIzaSyAxAkj3yS3nY3i1qMmANohaOqKZBHNeqV4",
|
|
authDomain: "webapp-9ec9c.firebaseapp.com",
|
|
projectId: "webapp-9ec9c",
|
|
storageBucket: "webapp-9ec9c.appspot.com",
|
|
messagingSenderId: "363941055701",
|
|
appId: "1:363941055701:web:dde5972e1019d968e4e65c",
|
|
measurementId: "G-F4RT64WY6M"
|
|
});
|
|
|
|
// Retrieve an instance of Firebase Messaging so that it can handle background
|
|
// messages.
|
|
const messaging = firebase.messaging();
|
|
|
|
messaging.onBackgroundMessage((payload) => {
|
|
console.log(
|
|
'[firebase-messaging-sw.js] Received background message ',
|
|
payload
|
|
);
|
|
// Customize notification here
|
|
//const notificationTitle = 'Background Message Title';
|
|
//const notificationOptions = {
|
|
// body: 'Background Message body.',
|
|
// icon: '/firebase-logo.png'
|
|
//};
|
|
|
|
//self.registration.showNotification(notificationTitle, notificationOptions);
|
|
});
|