diff --git a/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatCore.swift b/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatCore.swift index 8b3afc9..eb02d51 100644 --- a/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatCore.swift +++ b/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatCore.swift @@ -6,10 +6,12 @@ // Copyright © 2024 PomoNyang. All rights reserved. // +import AppService import APIClientInterface import UserServiceInterface import CatServiceInterface import UserNotificationClientInterface +import UserDefaultsClientInterface import DatabaseClientInterface import StreamListenerInterface import DesignSystem @@ -59,6 +61,7 @@ public struct SelectCatCore { @Dependency(UserService.self) var userService @Dependency(CatService.self) var catService @Dependency(UserNotificationClient.self) var userNotificationClient + @Dependency(UserDefaultsClient.self) var userDefaultClient @Dependency(DatabaseClient.self) var databaseClient @Dependency(StreamListener.self) var streamListener @@ -108,8 +111,10 @@ public struct SelectCatCore { case ._setNextAction: if state.route == .onboarding { return .run { send in - // user notification 요청 - _ = try await userNotificationClient.requestAuthorization([.alert, .badge, .sound]) + let isGranted = try await userNotificationClient.requestAuthorization([.alert, .badge, .sound]) + await setTimerAlarm(userDefaultsClient: self.userDefaultClient, isEnabled: isGranted) + await setDisturbAlarm(userDefaultsClient: self.userDefaultClient, isEnabled: isGranted) + await send(._moveToNamingCat) } } else { diff --git a/Projects/Feature/HomeFeature/Sources/Home/HomeView.swift b/Projects/Feature/HomeFeature/Sources/Home/HomeView.swift index ca0f80f..d1dbca7 100644 --- a/Projects/Feature/HomeFeature/Sources/Home/HomeView.swift +++ b/Projects/Feature/HomeFeature/Sources/Home/HomeView.swift @@ -108,7 +108,7 @@ public struct HomeView: View { if !store.isNetworkConnected { VStack { HStack(spacing: Alias.Spacing.small) { - DesignSystemAsset.Image._16NullPrimary.swiftUIImage + DesignSystemAsset.Image._16Offline.swiftUIImage Text("오프라인 모드") .font(Typography.bodySB) .foregroundStyle(Alias.Color.Text.secondary) diff --git a/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageCore.swift b/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageCore.swift index 5ca1c7b..d27008b 100644 --- a/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageCore.swift +++ b/Projects/Feature/MyPageFeature/Sources/MyPage/MyPageCore.swift @@ -80,7 +80,6 @@ public struct MyPageCore { private func core(state: inout State, action: Action) -> EffectOf { switch action { case .onAppear: - // TODO: userDefault get bool 은 옵셔널 값이 아니어서, 다른 방법을 사용해서 default setting 값 부여해야할듯 state.isTimerAlarmOn = getTimerAlarm(userDefaultsClient: self.userDefaultsClient) state.isDisturbAlarmOn = getDisturbAlarm(userDefaultsClient: self.userDefaultsClient) state.isLiveActivityOn = getLiveActivityState(userDefaultsClient: self.userDefaultsClient) diff --git a/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/16_offline.svg b/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/16_offline.svg new file mode 100644 index 0000000..611eeea --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/16_offline.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/Contents.json b/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/Contents.json new file mode 100644 index 0000000..ab95d65 --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Image.xcassets/16/16_offline.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "16_offline.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}