wakanda-wave
v1.0.17
Published
## Configure SW create file in your project with name `fireabse-messaging-sw.js`
Downloads
3
Readme
WAKANDA WAVE
Configure SW
create file in your project with name fireabse-messaging-sw.js
importScripts('https://www.gstatic.com/firebasejs/9.0.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/9.0.0/firebase-messaging.js');
import { getMessaging, onBackgroundMessage } from "firebase/messaging/sw";
import { initializeApp } from "firebase/app";
// Firebase credentials
const firebaseApp = = firebase.initializeApp({});
const messaging = getMessaging(firebaseApp);
onBackgroundMessage(messaging, (payload) => {
console.log('[firebase-messaging-sw.js] Received background message ', payload);
// Customize notification here
const notificationTitle = '${title}';
const notificationOptions = {};
self.registration.showNotification(notificationTitle,
notificationOptions);
});