diff --git a/frontend/public/firebase-messaging-sw.js b/frontend/public/firebase-messaging-sw.js index ddadf5dcb..9c7c8d76c 100644 --- a/frontend/public/firebase-messaging-sw.js +++ b/frontend/public/firebase-messaging-sw.js @@ -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); });