Skip to content

Commit

Permalink
Merge pull request #681 from woowacourse-teams/refactor/#680
Browse files Browse the repository at this point in the history
푸시 알림 클릭시 이동 문제 확인
  • Loading branch information
pricelees authored Oct 18, 2024
2 parents 52a8c4a + d84f889 commit 463a377
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/public/firebase-messaging-sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ self.addEventListener('notificationclick', function (event) {
// console.log('[firebase-messaging-sw.js] 알림이 클릭되었습니다.');

// 알림 데이터를 가져오기
const link = event.notification.data.FCM_MSG.notification.click_action;
const link = event.notification.data.FCM_MSG.data.link;

event.notification.close(); // 알림 닫기

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/service/forgroundMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function initializeForegroundMessageHandling() {
const notificationOptions = {
body: payload.notification?.body || '',
icon: payload.notification?.icon,
data: { link: payload.fcmOptions?.link || '/' },
data: { link: payload.data?.link || '/' },
};

if (Notification.permission === 'granted') {
Expand Down

0 comments on commit 463a377

Please sign in to comment.