diff --git a/src/firebase-messaging-sw.js b/src/firebase-messaging-sw.js new file mode 100644 index 0000000..7f35fc6 --- /dev/null +++ b/src/firebase-messaging-sw.js @@ -0,0 +1,17 @@ +import { environment } from "./environments/environment"; + +importScripts('https://www.gstatic.com/firebasejs/8.0.0/firebase-app.js'); +importScripts('https://www.gstatic.com/firebasejs/8.0.0/firebase-messaging.js'); + +firebase.initializeApp({ + apiKey: environment.firebase.apiKey, + authDomain: environment.firebase.authDomain, + databaseURL: environment.firebase.databaseURL, + projectId: environment.firebase.projectId, + storageBucket: environment.firebase.storageBucket, + messagingSenderId: environment.firebase.messagingSenderId, + appId: environment.firebase.appId, + measurementId: environment.firebase.measurementId +}); + +const messaging = firebase.messaging();