Skip to content

Commit

Permalink
fix: 알림이 undefined로 오는 문제를 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeml06 committed Aug 22, 2024
1 parent dfda238 commit e54ff74
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/public/firebase-messaging-sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ const messaging = firebase.messaging();
messaging.onBackgroundMessage((payload) => {
console.log('[firebase-messaging-sw.js] 백그라운드 메시지 수신:', payload);

const notificationTitle = payload.title;
const notificationTitle = payload.notification.title;
const notificationOptions = {
body: payload.body
// icon: payload.icon
body: payload.notification.body,
data: {
click_action: payload.fcmOptions.link, // 이 필드는 밑의 클릭 이벤트 처리에 사용됨
},
};
self.registration.showNotification(notificationTitle, notificationOptions);
});

0 comments on commit e54ff74

Please sign in to comment.