Skip to content

Commit

Permalink
feat(FE) : 백그라운드에서 메세지 수신 시 실행할 이벤트 추가 (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
201724554 committed Feb 17, 2023
1 parent 914f8fc commit f82f1b2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions client/firebase-messaging-sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
importScripts('https://www.gstatic.com/firebasejs/9.1.0/firebase-app-compat.js');
importScripts("https://www.gstatic.com/firebasejs/9.10.0/firebase-messaging-compat.js");

firebase.initializeApp({
apiKey: "AIzaSyCsLBsvozvTnYlDH-5cS0A8X_AjV5o4jjM",
authDomain: "amatta-4934f.firebaseapp.com",
projectId: "amatta-4934f",
storageBucket: "amatta-4934f.appspot.com",
messagingSenderId: "196308516589",
appId: "1:196308516589:web:64545440aa5021e8a496e4",
measurementId: "G-4JBCQPF50K"
});
const messaging = firebase.messaging();

messaging.onBackgroundMessage((payload)=>{
console.log("background received", payload);
});

0 comments on commit f82f1b2

Please sign in to comment.