Created
September 1, 2017 22:23
-
-
Save runtimeZero/71b6c2af4baff4690f18fcae793c729a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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('https://www.gstatic.com/firebasejs/3.9.0/firebase-app.js'); | |
importScripts('https://www.gstatic.com/firebasejs/3.9.0/firebase-messaging.js'); | |
// Initialize the Firebase app in the service worker by passing in the | |
// messagingSenderId. | |
var config = { | |
apiKey: "", | |
authDomain: "", | |
databaseURL: "", | |
projectId: "", | |
storageBucket: "", | |
messagingSenderId: "" | |
}; | |
firebase.initializeApp(config); | |
// Retrieve an instance of Firebase Messaging so that it can handle background | |
// messages. | |
const messaging = firebase.messaging(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment