앱 브리지 메소드명 변경: updateMessageCount -> updateAlarmCount

- updateMessageCount를 updateAlarmCount로 변경
- BridgeMessageType.UPDATE_MESSAGE_COUNT를 UPDATE_ALARM_COUNT로 변경
- header에서 알림 카운트 조회 시 네이티브 앱에 카운트 업데이트 적용

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jay Sheen
2025-10-28 19:25:22 +09:00
parent fb65ace1a0
commit cf428c7466
4 changed files with 16 additions and 9 deletions

View File

@@ -166,9 +166,9 @@ class AppBridge {
return this.sendMessage(BridgeMessageType.GET_LANGUAGE);
}
// 메시지 카운트 업데이트
async updateMessageCount(count: number): Promise<void> {
return this.sendMessage(BridgeMessageType.UPDATE_MESSAGE_COUNT, { count });
// 알림 카운트 업데이트
async updateAlarmCount(count: number): Promise<void> {
return this.sendMessage(BridgeMessageType.UPDATE_ALARM_COUNT, { count });
}
// 네이티브 환경 체크

View File

@@ -64,8 +64,8 @@ export enum BridgeMessageType {
SET_LANGUAGE = 'setLanguage',
GET_LANGUAGE = 'getLanguage',
// 메시지 카운트 업데이트
UPDATE_MESSAGE_COUNT = 'updateMessageCount',
// 알림 카운트 업데이트
UPDATE_ALARM_COUNT = 'updateAlarmCount',
// 푸시 알림 권한 확인
IS_PUSH_NOTIFICATION_ENABLED = 'isPushNotificationEnabled',

View File

@@ -190,9 +190,9 @@ class AppBridge {
return this.sendMessage(BridgeMessageType.GET_LANGUAGE);
}
// 메시지 카운트 업데이트
async updateMessageCount(count: number): Promise<void> {
return this.sendMessage(BridgeMessageType.UPDATE_MESSAGE_COUNT, { count });
// 알림 카운트 업데이트
async updateAlarmCount(count: number): Promise<void> {
return this.sendMessage(BridgeMessageType.UPDATE_ALARM_COUNT, { count });
}
// 푸시 알림 권한 확인

View File

@@ -2,7 +2,7 @@ import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { Menu } from '@/shared/ui/menu';
import { IMAGE_ROOT } from '@/shared/constants/common';
import { PATHS } from '@/shared/constants/paths';
import {
import {
HeaderType,
HeaderNavigationProps
} from '@/entities/common/model/types';
@@ -10,6 +10,7 @@ import { useStore } from '@/shared/model/store';
import { ChangeEvent, useEffect, useState } from 'react';
import { AppAlarmUnreadCountParams, AppAlarmUnreadCountResponse, MERCHANT_ADMIN_APP } from '@/entities/alarm/model/types';
import { useAppAlarmUnreadCountMutation } from '@/entities/alarm/api/use-app-alarm-unread-count-mutation';
import { appBridge } from '@/utils/appBridge';
export const HeaderNavigation = ({
onBack,
@@ -63,6 +64,12 @@ export const HeaderNavigation = ({
};
appAlarmUnreadCount(params).then((rs: AppAlarmUnreadCountResponse) => {
setUnreadCount(rs.unreadCount);
// 네이티브 앱에 알림 카운트 업데이트
if(appBridge.isNativeEnvironment()){
appBridge.updateAlarmCount(rs.unreadCount).catch((error) => {
console.error('Failed to update alarm count:', error);
});
}
});
}
};