Skip to content

Commit

Permalink
updated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Meraj-Webkul committed Dec 1, 2021
1 parent 6f692bb commit 07b3453
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
19 changes: 9 additions & 10 deletions publishable/pwa/dist/service-worker.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,17 @@ function formFilter(response) {
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-messaging.js');
var firebaseConfig = {
apiKey: "AIzaSyAYa4bg95RCjz-r6hc6A_Rz98iE_ySgjis",
authDomain: "pwa-m-2a314.firebaseapp.com",
databaseURL: "https://pwa-m-2a314-default-rtdb.firebaseio.com",
projectId: "pwa-m-2a314",
storageBucket: "pwa-m-2a314.appspot.com",
messagingSenderId: "709349998192",
appId: "1:709349998192:web:24a8d491622ad1a8583eb5",
measurementId: "G-J71CG5K3WD"
apiKey: "{{core()->getConfigData('pwa.settings.push-notification.web-api-key')}}",
authDomain: "{{core()->getConfigData('pwa.settings.push-notification.auth-domain')}}",
databaseURL: "{{core()->getConfigData('pwa.settings.push-notification.database-url')}}",
projectId: "{{core()->getConfigData('pwa.settings.push-notification.project-id')}}",
storageBucket: "",
messagingSenderId: "{{core()->getConfigData('pwa.settings.push-notification.messaging-id')}}",
appId: "{{core()->getConfigData('pwa.settings.push-notification.app-id')}}"
}; // Initialize the Firebase app in the service worker by passing in themessagingSenderId.

firebase.initializeApp({
'messagingSenderId': "709349998192"
'messagingSenderId': "{{core()->getConfigData('pwa.settings.push-notification.messaging-id')}}"
}); // Retrieve an instance of Firebase Messaging so that it can handle background messages

var messaging = firebase.messaging(); // Add the public key generated from the console here.
Expand All @@ -192,4 +191,4 @@ var messaging = firebase.messaging(); // Add the public key generated from the c
// };
// return self.registration.showNotification(notificationTitle,
// notificationOptions);
// });
// });
4 changes: 2 additions & 2 deletions publishable/pwa/firebase-messaging-sw.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-messaging.js');

firebase.initializeApp({messagingSenderId: "709349998192");
firebase.initializeApp({messagingSenderId: "{{core()->getConfigData('pwa.settings.push-notification.messaging-id')}}"}");

const messaging = firebase.messaging();

Expand All @@ -28,4 +28,4 @@ messaging.setBackgroundMessageHandler(function(payload)
event.waitUntil(
clients.openWindow(action_click)
);
});
});

0 comments on commit 07b3453

Please sign in to comment.