move firebase credentials to a separate file
This commit is contained in:
+5
-12
@@ -1,16 +1,9 @@
|
||||
// Must be located at the root.
|
||||
'use strict';
|
||||
importScripts("https://unpkg.com/firebase@5.5.1/firebase-app.js");
|
||||
importScripts("https://unpkg.com/firebase@5.5.1/firebase-messaging.js");
|
||||
importScripts("/firebase-init.js")
|
||||
|
||||
importScripts("https://unpkg.com/firebase@5.5.0/firebase-app.js");
|
||||
importScripts("https://unpkg.com/firebase@5.5.0/firebase-messaging.js");
|
||||
|
||||
const FIREBASE_PUBLIC_API_KEY = "AIzaSyD6X4ULR-RUsobvs1zZ2bHdJuPz39q2tbQ";
|
||||
const FIREBASE_SENDER_ID = "114126160546";
|
||||
|
||||
firebase.initializeApp({
|
||||
apiKey: FIREBASE_PUBLIC_API_KEY,
|
||||
messagingSenderId: FIREBASE_SENDER_ID
|
||||
});
|
||||
firebase.initializeApp(FIREBASE_INIT);
|
||||
|
||||
firebase.messaging().setBackgroundMessageHandler(function(payload) {
|
||||
let title = payload.notification.title || "New message";
|
||||
@@ -19,6 +12,6 @@ firebase.messaging().setBackgroundMessageHandler(function(payload) {
|
||||
icon: '/img/logo96.png'
|
||||
};
|
||||
console.log("background message", payload);
|
||||
|
||||
|
||||
return self.registration.showNotification(title, options);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user