알림 수신 설정 푸시 권한 연동 구현

- 앱브리지에 isPushNotificationEnabled, openAppSettings 메서드 추가
- 설정 페이지에서 푸시 알림 권한 상태에 따라 알림 수신 설정 토글 표시
- 알림 수신 설정 토글 클릭 시 앱 설정 화면으로 이동
- 푸시 권한이 꺼져있으면 하위 알림 토글들(11, 21, 31, 41, 61, 62) 비활성화
- 앱이 포어그라운드로 돌아올 때 푸시 권한 상태 재확인하여 UI 업데이트

🤖 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-27 16:49:50 +09:00
parent f511517050
commit 5afc15e861
4 changed files with 98 additions and 19 deletions

View File

@@ -53,6 +53,12 @@ interface UseAppBridgeReturn {
openBiometricRegistrationPopup: () => Promise<boolean>;
// 간편 인증 등록 팝업 닫기
closeBiometricRegistrationPopup: () => Promise<void>;
// 푸시 알림 권한 확인
isPushNotificationEnabled: () => Promise<boolean>;
// 앱 설정 화면 열기
openAppSettings: () => Promise<void>;
}
export const useAppBridge = (): UseAppBridgeReturn => {
@@ -214,7 +220,7 @@ export const useAppBridge = (): UseAppBridgeReturn => {
console.warn('Web Share API failed:', error);
}
}
// 폴백: 클립보드에 복사
const shareText = `${content.title}\n${content.text}${content.url ? `\n${content.url}` : ''}`;
if (navigator.clipboard) {
@@ -225,10 +231,25 @@ export const useAppBridge = (): UseAppBridgeReturn => {
}
return;
}
return appBridge.safeCall(() => appBridge.shareContent(content));
}, [isNativeEnvironment]);
const isPushNotificationEnabled = useCallback(async (): Promise<boolean> => {
if (!isNativeEnvironment) {
return true;
}
const result = await appBridge.safeCall(() => appBridge.isPushNotificationEnabled(), false);
return result || false;
}, [isNativeEnvironment]);
const openAppSettings = useCallback(async (): Promise<void> => {
if (!isNativeEnvironment) {
return;
}
return appBridge.safeCall(() => appBridge.openAppSettings());
}, [isNativeEnvironment]);
return {
isNativeEnvironment,
isAndroid,
@@ -249,6 +270,8 @@ export const useAppBridge = (): UseAppBridgeReturn => {
requestRefreshToken,
registerBiometric,
openBiometricRegistrationPopup,
closeBiometricRegistrationPopup
closeBiometricRegistrationPopup,
isPushNotificationEnabled,
openAppSettings
};
};