Env Based Firebase SW.
This commit is contained in:
@@ -3,26 +3,44 @@ importScripts("https://www.gstatic.com/firebasejs/8.2.0/firebase-app.js");
|
|||||||
importScripts("https://www.gstatic.com/firebasejs/8.2.0/firebase-messaging.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
|
// Initialize the Firebase app in the service worker by passing the generated config
|
||||||
const firebaseConfig = {
|
let firebaseConfig;
|
||||||
apiKey: "AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc",
|
switch (this.location.hostname) {
|
||||||
authDomain: "imex-dev.firebaseapp.com",
|
case "localhost":
|
||||||
databaseURL: "https://imex-dev.firebaseio.com",
|
firebaseConfig = {
|
||||||
projectId: "imex-dev",
|
apiKey: "AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc",
|
||||||
storageBucket: "imex-dev.appspot.com",
|
authDomain: "imex-dev.firebaseapp.com",
|
||||||
messagingSenderId: "759548147434",
|
databaseURL: "https://imex-dev.firebaseio.com",
|
||||||
appId: "1:759548147434:web:e8239868a48ceb36700993",
|
projectId: "imex-dev",
|
||||||
measurementId: "G-K5XRBVVB4S",
|
storageBucket: "imex-dev.appspot.com",
|
||||||
};
|
messagingSenderId: "759548147434",
|
||||||
// const firebaseConfig = {
|
appId: "1:759548147434:web:e8239868a48ceb36700993",
|
||||||
// apiKey: "AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU",
|
measurementId: "G-K5XRBVVB4S",
|
||||||
// authDomain: "imex-prod.firebaseapp.com",
|
};
|
||||||
// databaseURL: "https://imex-prod.firebaseio.com",
|
break;
|
||||||
// projectId: "imex-prod",
|
case "test.imex.online":
|
||||||
// storageBucket: "imex-prod.appspot.com",
|
firebaseConfig = {
|
||||||
// messagingSenderId: "253497221485",
|
apiKey: "AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c",
|
||||||
// appId: "1:253497221485:web:3c81c483b94db84b227a64",
|
authDomain: "imex-test.firebaseapp.com",
|
||||||
// measurementId: "G-NTWBKG2L0M",
|
projectId: "imex-test",
|
||||||
// }
|
storageBucket: "imex-test.appspot.com",
|
||||||
|
messagingSenderId: "991923618608",
|
||||||
|
appId: "1:991923618608:web:633437569cdad78299bef5",
|
||||||
|
// measurementId: "${config.measurementId}",
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case "imex.online":
|
||||||
|
default:
|
||||||
|
firebaseConfig = {
|
||||||
|
apiKey: "AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU",
|
||||||
|
authDomain: "imex-prod.firebaseapp.com",
|
||||||
|
databaseURL: "https://imex-prod.firebaseio.com",
|
||||||
|
projectId: "imex-prod",
|
||||||
|
storageBucket: "imex-prod.appspot.com",
|
||||||
|
messagingSenderId: "253497221485",
|
||||||
|
appId: "1:253497221485:web:3c81c483b94db84b227a64",
|
||||||
|
measurementId: "G-NTWBKG2L0M",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
firebase.initializeApp(firebaseConfig);
|
firebase.initializeApp(firebaseConfig);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user