Skip to content

Commit

Permalink
test: fcm test
Browse files Browse the repository at this point in the history
  • Loading branch information
eun-hak committed Jun 3, 2024
1 parent 1d1a917 commit 42f6a15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions public/firebase-messaging-sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ firebase.initializeApp({
projectId: 'sabujak-56c99',
storageBucket: 'sabujak-56c99.appspot.com',
messagingSenderId: '791652948273',
appId: '1:791652948273:web:374b4b68ef709669a2b810'
appId: '1:791652948273:web:7899ddf709d181bca2b810'
});

// 푸시 내용을 처리해서 알림으로 띄운다.
self.addEventListener('push', function (event) {
if (event.data) {
console.log(event.data.json().data);
console.log(event.data.json().notification.body);
console.log(event.data.json().notification);
// 알림 메세지일 경우엔 event.data.json().notification;
const data = event.data.json().data;
const data = event.data.json().notification;
const options = {
body: data.body,
icon: data.image,
Expand Down

0 comments on commit 42f6a15

Please sign in to comment.