Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to V1.3.3 #206

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated dynamic api details
  • Loading branch information
Meraj-Webkul committed Dec 1, 2021
commit ff0290f5009aaa1dd536fa1930a964b95a0ff9c2
25 changes: 9 additions & 16 deletions publishable/pwa/service-worker.js
Original file line number Diff line number Diff line change
@@ -191,27 +191,20 @@ function formFilter(response) {
});
}

// Give the service worker access to Firebase Messaging.
// Note that you can only use Firebase Messaging here, other Firebase libraries are not available in the service worker.
importScripts('http://www.gstatic.com/firebasejs/4.8.1/firebase-app.js');
importScripts('http://www.gstatic.com/firebasejs/4.8.1/firebase-messaging.js');

const 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
const messaging = firebase.messaging();

@@ -241,4 +234,4 @@ const messaging = firebase.messaging();

// return self.registration.showNotification(notificationTitle,
// notificationOptions);
// });
// });