Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

firebase-messaging-sw.js 1.0KB

123456789101112131415161718192021222324252627
  1. importScripts('https://www.gstatic.com/firebasejs/7.0.0/firebase-app.js');
  2. importScripts('https://www.gstatic.com/firebasejs/7.0.0/firebase-messaging.js');
  3. var firebaseConfig = {
  4. apiKey: "AIzaSyBJMDMk5s1Naxq5pW0cfcC4sSg_ExMyJYM",
  5. authDomain: "sipadu-johor.firebaseapp.com",
  6. databaseURL: "https://sipadu-johor.firebaseio.com",
  7. projectId: "sipadu-johor",
  8. storageBucket: "sipadu-johor.appspot.com",
  9. messagingSenderId: "790988903295",
  10. appId: "1:790988903295:web:89a8a3754829aa5649804a"
  11. };
  12. // Initialize Firebase
  13. firebase.initializeApp(firebaseConfig);
  14. const messaging = firebase.messaging();
  15. messaging.setBackgroundMessageHandler(function(payload) {
  16. console.log('[firebase-messaging-sw.js] Received background message ', payload);
  17. // Customize notification here
  18. const title = 'Background Message Title';
  19. const options = {
  20. body: 'Background Message body.',
  21. icon: 'https://mdch1.sipadu.my/images/logo/512mpkb.png'
  22. };
  23. return self.registration.showNotification(title, options);
  24. });