|
|
@@ -1,27 +1,27 @@ |
|
|
|
importScripts('https://www.gstatic.com/firebasejs/7.0.0/firebase-app.js');
|
|
|
|
importScripts('https://www.gstatic.com/firebasejs/7.0.0/firebase-messaging.js');
|
|
|
|
|
|
|
|
var firebaseConfig = {
|
|
|
|
apiKey: "AIzaSyB7keN56ITS_wLImT1G8t2LwB2SY_ejedI",
|
|
|
|
authDomain: "sipadu-mdch.firebaseapp.com",
|
|
|
|
databaseURL: "https://sipadu-mdch.firebaseio.com",
|
|
|
|
projectId: "sipadu-mdch",
|
|
|
|
storageBucket: "",
|
|
|
|
messagingSenderId: "379374790363",
|
|
|
|
appId: "1:379374790363:web:219670d6d79a10f76d8efe"
|
|
|
|
};
|
|
|
|
// Initialize Firebase
|
|
|
|
firebase.initializeApp(firebaseConfig);
|
|
|
|
|
|
|
|
const messaging = firebase.messaging();
|
|
|
|
messaging.setBackgroundMessageHandler(function(payload) {
|
|
|
|
console.log('[firebase-messaging-sw.js] Received background message ', payload);
|
|
|
|
// Customize notification here
|
|
|
|
const title = 'Background Message Title';
|
|
|
|
const options = {
|
|
|
|
body: 'Background Message body.',
|
|
|
|
icon: 'https://mdch1.sipadu.my/images/logo/512mpkb.png'
|
|
|
|
};
|
|
|
|
|
|
|
|
return self.registration.showNotification(title, options);
|
|
|
|
}); |
|
|
|
importScripts('https://www.gstatic.com/firebasejs/7.0.0/firebase-app.js'); |
|
|
|
importScripts('https://www.gstatic.com/firebasejs/7.0.0/firebase-messaging.js'); |
|
|
|
|
|
|
|
var firebaseConfig = { |
|
|
|
apiKey: "AIzaSyBJMDMk5s1Naxq5pW0cfcC4sSg_ExMyJYM", |
|
|
|
authDomain: "sipadu-johor.firebaseapp.com", |
|
|
|
databaseURL: "https://sipadu-johor.firebaseio.com", |
|
|
|
projectId: "sipadu-johor", |
|
|
|
storageBucket: "sipadu-johor.appspot.com", |
|
|
|
messagingSenderId: "790988903295", |
|
|
|
appId: "1:790988903295:web:89a8a3754829aa5649804a" |
|
|
|
}; |
|
|
|
// Initialize Firebase |
|
|
|
firebase.initializeApp(firebaseConfig); |
|
|
|
|
|
|
|
const messaging = firebase.messaging(); |
|
|
|
messaging.setBackgroundMessageHandler(function(payload) { |
|
|
|
console.log('[firebase-messaging-sw.js] Received background message ', payload); |
|
|
|
// Customize notification here |
|
|
|
const title = 'Background Message Title'; |
|
|
|
const options = { |
|
|
|
body: 'Background Message body.', |
|
|
|
icon: 'https://mdch1.sipadu.my/images/logo/512mpkb.png' |
|
|
|
}; |
|
|
|
|
|
|
|
return self.registration.showNotification(title, options); |
|
|
|
}); |