Refactor FCM service worker
This commit is contained in:
parent
7bed14e238
commit
547ad63812
1 changed files with 17 additions and 0 deletions
17
src/firebase-messaging-sw.js
Normal file
17
src/firebase-messaging-sw.js
Normal file
|
@ -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();
|
Reference in a new issue