mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('./firebase-messaging-sw.js')
|
||||
.then(function(registration) {
|
||||
}).catch(function(err) {
|
||||
});
|
||||
}
|
||||
// Scripts for firebase and firebase messaging
|
||||
|
||||
|
||||
/* importScripts('https://www.gstatic.com/firebasejs/8.2.0/firebase-app.js');
|
||||
importScripts('https://www.gstatic.com/firebasejs/8.2.0/firebase-messaging.js');
|
||||
|
||||
// Initialize the Firebase app in the service worker by passing the generated config
|
||||
var firebaseConfig = {
|
||||
apiKey: "AIzaSyAAdHmTFznCMerdT99nrewJgISRvtxPqoY",
|
||||
authDomain: "gabinete-digital-2020.firebaseapp.com",
|
||||
databaseURL: "https://gabinete-digital-2020.firebaseio.com",
|
||||
projectId: "gabinete-digital-2020",
|
||||
storageBucket: "gabinete-digital-2020.appspot.com",
|
||||
messagingSenderId: "800733765231",
|
||||
appId: "1:800733765231:web:28e7792ab150006513779a",
|
||||
measurementId: "G-8QN4BLZ8XK"
|
||||
};
|
||||
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
|
||||
// Retrieve firebase messaging
|
||||
const messaging = firebase.messaging();
|
||||
|
||||
messaging.onBackgroundMessage(function(payload) {
|
||||
console.log('Received background message ', payload);
|
||||
|
||||
const notificationTitle = payload.notification.title;
|
||||
const notificationOptions = {
|
||||
body: payload.notification.body,
|
||||
};
|
||||
|
||||
self.registration.showNotification(notificationTitle,
|
||||
notificationOptions);
|
||||
}); */
|
||||
Reference in New Issue
Block a user