From f5e6bdd356ab61f88ae6abfdbccb1100103d08f0 Mon Sep 17 00:00:00 2001 From: yeonee Date: Sat, 4 Jul 2026 01:48:21 +0900 Subject: [PATCH 1/8] =?UTF-8?q?setting:=20#470=20Firebase=20Remote=20Confi?= =?UTF-8?q?g=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ByeBoo-iOS/ByeBoo-iOS.xcodeproj/project.pbxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ByeBoo-iOS/ByeBoo-iOS.xcodeproj/project.pbxproj b/ByeBoo-iOS/ByeBoo-iOS.xcodeproj/project.pbxproj index ec9db3ef..2967de7b 100644 --- a/ByeBoo-iOS/ByeBoo-iOS.xcodeproj/project.pbxproj +++ b/ByeBoo-iOS/ByeBoo-iOS.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 183EE0E12ED1D10600154F40 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 183EE0E02ED1D10600154F40 /* FirebaseMessaging */; }; 186847F02ED5567D002827DA /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; productRef = 186847EF2ED5567D002827DA /* FirebaseCore */; }; 18A8172D2E154F3D00F68F9F /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 18A8172C2E154F3D00F68F9F /* Alamofire */; }; + 514D021B2FF6ADDD0041A4E1 /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = 514D021A2FF6ADDD0041A4E1 /* FirebaseRemoteConfig */; }; 515C127F2E159D45001BA2E0 /* Then in Frameworks */ = {isa = PBXBuildFile; productRef = 515C127E2E159D45001BA2E0 /* Then */; }; 515C12822E159D77001BA2E0 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 515C12812E159D77001BA2E0 /* SnapKit */; }; 51691DED2E5CB059008CCEC6 /* KakaoSDKAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 51691DEC2E5CB059008CCEC6 /* KakaoSDKAuth */; }; @@ -77,6 +78,7 @@ CBB032A72E7925FC00C0855E /* Mixpanel in Frameworks */, 51691DED2E5CB059008CCEC6 /* KakaoSDKAuth in Frameworks */, CB71A8A32F3B6F9400176B64 /* FirebaseCrashlytics in Frameworks */, + 514D021B2FF6ADDD0041A4E1 /* FirebaseRemoteConfig in Frameworks */, 183EE0E12ED1D10600154F40 /* FirebaseMessaging in Frameworks */, 183EE0DB2ED1CB0E00154F40 /* FirebaseAnalytics in Frameworks */, ); @@ -151,6 +153,7 @@ 183EE0E02ED1D10600154F40 /* FirebaseMessaging */, 186847EF2ED5567D002827DA /* FirebaseCore */, CB71A8A22F3B6F9400176B64 /* FirebaseCrashlytics */, + 514D021A2FF6ADDD0041A4E1 /* FirebaseRemoteConfig */, ); productName = "ByeBoo-iOS"; productReference = CB41808B2E0925D2001E7BCB /* ByeBoo-iOS.app */; @@ -671,6 +674,11 @@ package = 18A8172B2E154F3D00F68F9F /* XCRemoteSwiftPackageReference "Alamofire" */; productName = Alamofire; }; + 514D021A2FF6ADDD0041A4E1 /* FirebaseRemoteConfig */ = { + isa = XCSwiftPackageProductDependency; + package = 183EE0D92ED1CB0E00154F40 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseRemoteConfig; + }; 515C127E2E159D45001BA2E0 /* Then */ = { isa = XCSwiftPackageProductDependency; package = 515C127D2E159D45001BA2E0 /* XCRemoteSwiftPackageReference "Then" */; From 858b2731014010277e5ef9d77d668fbf5bcd6741 Mon Sep 17 00:00:00 2001 From: yeonee Date: Sat, 4 Jul 2026 01:48:41 +0900 Subject: [PATCH 2/8] =?UTF-8?q?chore:=20#470=20=EC=9D=98=EC=A1=B4=EC=84=B1?= =?UTF-8?q?=20=EC=A3=BC=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ByeBoo-iOS/Domain/DomainDependencyAssembler.swift | 4 ++++ .../PresentationDependencyAssembler.swift | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift b/ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift index 67e7c71f..caecb078 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift @@ -255,5 +255,9 @@ struct DomainDependencyAssembler: DependencyAssembler { DIContainer.shared.register(type: ReadAllNotificationsUseCase.self) { _ in return DefaultReadAllNotificationsUseCase(repository: notificationRepository) } + + DIContainer.shared.register(type: CheckForceUpdateUseCase.self) { _ in + return DefaultCheckForceUpdateUsecase(repository: DefaultForceUpdateManager()) + } } } diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/PresentationDependencyAssembler.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/PresentationDependencyAssembler.swift index c94b6a22..a4f136fa 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/PresentationDependencyAssembler.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/PresentationDependencyAssembler.swift @@ -265,14 +265,15 @@ struct PresentationDependencyAssembler: DependencyAssembler { } DIContainer.shared.register(type: SplashViewModel.self) { container in - guard let autoLoginUseCase = container.resolve( - type: AutoLoginUseCase.self - ) - else { + guard let autoLoginUseCase = container.resolve(type: AutoLoginUseCase.self), + let checkForceUpdateUseCase = container.resolve(type: CheckForceUpdateUseCase.self) else { ByeBooLogger.error(ByeBooError.DIFailedError) return } - return SplashViewModel(autoLoginUseCase: autoLoginUseCase) + return SplashViewModel( + autoLoginUseCase: autoLoginUseCase, + checkForceUpdateUseCase: checkForceUpdateUseCase + ) } DIContainer.shared.register(type: FinishJourneyViewModel.self) { container in From fdf49aeac8b667d89281119fc78e0a4e79213cb9 Mon Sep 17 00:00:00 2001 From: yeonee Date: Sat, 4 Jul 2026 01:49:01 +0900 Subject: [PATCH 3/8] =?UTF-8?q?style:=20#470=20=EA=B0=95=EC=A0=9C=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8=20=EC=95=8C=EB=9F=BF=20?= =?UTF-8?q?=EB=B7=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/Modal/ForceUpdateModalView.swift | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 ByeBoo-iOS/ByeBoo-iOS/Presentation/Common/Modal/ForceUpdateModalView.swift diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Common/Modal/ForceUpdateModalView.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Common/Modal/ForceUpdateModalView.swift new file mode 100644 index 00000000..64d5f6ea --- /dev/null +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Common/Modal/ForceUpdateModalView.swift @@ -0,0 +1,60 @@ +// +// ForceUpdateModalView.swift +// ByeBoo-iOS +// +// Created by 이나연 on 7/4/26. +// + +import UIKit + +import SnapKit +import Then + +final class ForceUpdateModalView: BaseView, ModalProtocol { + let actionButton: ByeBooButton = ByeBooButton(titleText: "업데이트 하러 가기", type: .enabled) + let dismissButton: ByeBooButton? = nil + let modalType: ConfirmModalType? = nil + + private let titleLabel = UILabel() + private let descriptionLabel = UILabel() + + override func setUI() { + addSubviews(titleLabel, descriptionLabel, actionButton) + } + + override func setStyle() { + backgroundColor = .grayscale900 + layer.cornerRadius = 12 + + titleLabel.applyByeBooFont( + style: .sub3M18, + text: "새로운 업데이트가 있어요", + color: .grayscale50 + ) + + descriptionLabel.applyByeBooFont( + style: .body3R16, + text: "더 나은 바이부를 만나보세요", + color: .grayscale400 + ) + } + + override func setLayout() { + titleLabel.snp.makeConstraints { + $0.top.equalToSuperview().inset(24.adjustedH) + $0.centerX.equalToSuperview() + } + descriptionLabel.snp.makeConstraints { + $0.top.equalTo(titleLabel.snp.bottom).offset(16.adjustedH) + $0.centerX.equalToSuperview() + } + actionButton.snp.makeConstraints { + $0.top.equalTo(descriptionLabel.snp.bottom).offset(16.adjustedH) + $0.centerX.equalToSuperview() + $0.horizontalEdges.equalToSuperview().inset(24.adjustedW) + $0.bottom.equalToSuperview().inset(24.adjustedH) + $0.height.equalTo(53.adjustedH) + } + } +} + From cbf93c60bbefafda56f9f2242d7bc089e0831d50 Mon Sep 17 00:00:00 2001 From: yeonee Date: Sat, 4 Jul 2026 01:49:14 +0900 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20#470=20=EC=95=B1=20=EC=8A=A4?= =?UTF-8?q?=ED=86=A0=EC=96=B4=20=EA=B4=80=EB=A0=A8=20enum=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ByeBoo-iOS/Presentation/Enum/AppConstants.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ByeBoo-iOS/ByeBoo-iOS/Presentation/Enum/AppConstants.swift diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Enum/AppConstants.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Enum/AppConstants.swift new file mode 100644 index 00000000..1ab8cedf --- /dev/null +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Enum/AppConstants.swift @@ -0,0 +1,11 @@ +// +// AppConstants.swift +// ByeBoo-iOS +// +// Created by 이나연 on 7/4/26. +// + +enum AppConstants { + static let appStoreID = "6748205348" + static let appStoreURL = "itms-apps://itunes.apple.com/app/id\(appStoreID)" +} From ab077e247b9d1e0ac42a0b10781d37c2c87ff45b Mon Sep 17 00:00:00 2001 From: yeonee Date: Sat, 4 Jul 2026 01:49:31 +0900 Subject: [PATCH 5/8] =?UTF-8?q?feat:=20#470=20=EC=B5=9C=EC=86=8C=20?= =?UTF-8?q?=EB=B2=84=EC=A0=84=EB=B3=B4=EB=8B=A4=20=EB=82=AE=EC=9D=84=20?= =?UTF-8?q?=EC=8B=9C=20=EC=95=B1=EC=8A=A4=ED=86=A0=EC=96=B4=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=ED=95=98=EB=8F=84=EB=A1=9D=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ForceUpdateManager.swift | 44 ++++++++++++++ .../UseCase/CheckForceUpdateUseCase.swift | 25 ++++++++ .../ViewController/SplashViewController.swift | 60 +++++++++++++++++-- .../Login/ViewModel/SplashViewModel.swift | 36 +++++++++-- 4 files changed, 153 insertions(+), 12 deletions(-) create mode 100644 ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift create mode 100644 ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift diff --git a/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift b/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift new file mode 100644 index 00000000..35c31a9c --- /dev/null +++ b/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift @@ -0,0 +1,44 @@ +// +// RemoteConfigeManager.swift +// ByeBoo-iOS +// +// Created by 이나연 on 7/2/26. +// + +import FirebaseRemoteConfig + +protocol ForceUpdateManager { + func checkForUpdate() async throws-> Bool +} + +final class DefaultForceUpdateManager: ForceUpdateManager { + let remoteConfig = RemoteConfig.remoteConfig() + + init() { + let settings = RemoteConfigSettings() + settings.minimumFetchInterval = 0 + RemoteConfig.remoteConfig().configSettings = settings + } + + func checkForUpdate() async throws -> Bool { + do { + try await remoteConfig.fetch() + try await remoteConfig.activate() + + let minimumVersion = remoteConfig["min_version_code"].stringValue + + return isUpdateRequired(minimumVersion: minimumVersion) + } catch { + return false + } + } + + private var currentAppVersion: String { + Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "0.0.0" + } + + private func isUpdateRequired(minimumVersion: String) -> Bool { + ByeBooLogger.debug("현재버전: \(currentAppVersion), 최소버전: \(minimumVersion)") + return currentAppVersion.compare(minimumVersion, options: .numeric) == .orderedAscending + } +} diff --git a/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift b/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift new file mode 100644 index 00000000..e7745234 --- /dev/null +++ b/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift @@ -0,0 +1,25 @@ +// +// CheckForceUpdateUseCase.swift +// ByeBoo-iOS +// +// Created by 이나연 on 7/4/26. +// + +import Foundation + +protocol CheckForceUpdateUseCase { + func execute() async throws -> Bool +} + +struct DefaultCheckForceUpdateUsecase: CheckForceUpdateUseCase { + + private let repository: ForceUpdateManager + + init(repository: ForceUpdateManager) { + self.repository = repository + } + + func execute() async throws -> Bool { + return try await repository.checkForUpdate() + } +} diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewController/SplashViewController.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewController/SplashViewController.swift index 36807631..44dc49db 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewController/SplashViewController.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewController/SplashViewController.swift @@ -9,26 +9,33 @@ import Combine import UIKit final class SplashViewController: BaseViewController { - + private let rootView = SplashView() private let viewModel: SplashViewModel private var cancellables = Set() - + private var isFirstLaunch = true + init(viewModel: SplashViewModel) { self.viewModel = viewModel super.init(nibName: nil, bundle: nil) } - + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - + override func viewDidLoad() { view = rootView viewModel.action(.viewDidLoad) bind() - setAddTarget() + NotificationCenter.default.addObserver( + self, + selector: #selector(appDidBecomeActive), + name: UIApplication.didBecomeActiveNotification, + object: nil + ) + DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) { [weak self] in guard let self = self else { return } if self.cancellables.isEmpty { @@ -39,8 +46,26 @@ final class SplashViewController: BaseViewController { } extension SplashViewController { - private func bind() { + bindCheckForceUpdate() + bindAutoLogin() + } + + private func bindCheckForceUpdate() { + viewModel.output.forceUpdatePublisher + .receive(on: DispatchQueue.main) + .sink { result in + switch result { + case true: + self.presentForceUpdateModal() + case false: + self.viewModel.action(.tryAutoLogin) + } + } + .store(in: &cancellables) + } + + private func bindAutoLogin() { viewModel.output.autoLoginPublisher .receive(on: DispatchQueue.main) .sink { result in @@ -77,6 +102,29 @@ extension SplashViewController { } .store(in: &cancellables) } + + private func presentForceUpdateModal() { + let modal = ModalBuilder( + modalView: ForceUpdateModalView(), + action: openAppstore, + rootViewController: self + ) + modal.present() + } + + private func openAppstore() { + guard let url = URL(string: AppConstants.appStoreURL) else { return } + UIApplication.shared.open(url) + } + + @objc + private func appDidBecomeActive() { + guard !isFirstLaunch else { + isFirstLaunch = false + return + } + viewModel.action(.viewDidLoad) + } } extension SplashViewController { diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewModel/SplashViewModel.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewModel/SplashViewModel.swift index 4e880c44..27d0b3c2 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewModel/SplashViewModel.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewModel/SplashViewModel.swift @@ -9,22 +9,27 @@ import Combine import Foundation final class SplashViewModel { - + private var autoLoginSubject: PassthroughSubject, Never> = .init() - + private var forceUpdateSubject: PassthroughSubject = .init() + var output: Output { Output( - autoLoginPublisher: autoLoginSubject.eraseToAnyPublisher() + autoLoginPublisher: autoLoginSubject.eraseToAnyPublisher(), + forceUpdatePublisher: forceUpdateSubject.eraseToAnyPublisher() ) } - + private var cancellables = Set() private let autoLoginUseCase: AutoLoginUseCase - + private let checkForceUpdateUseCase: CheckForceUpdateUseCase + init( - autoLoginUseCase: AutoLoginUseCase + autoLoginUseCase: AutoLoginUseCase, + checkForceUpdateUseCase: CheckForceUpdateUseCase ) { self.autoLoginUseCase = autoLoginUseCase + self.checkForceUpdateUseCase = checkForceUpdateUseCase } } @@ -32,15 +37,19 @@ final class SplashViewModel { extension SplashViewModel { enum Input { case viewDidLoad + case tryAutoLogin } struct Output { let autoLoginPublisher: AnyPublisher, Never> + let forceUpdatePublisher: AnyPublisher } func action(_ trigger: Input) { switch trigger { case .viewDidLoad: + checkForceUpdate() + case .tryAutoLogin: autoLogin() } } @@ -48,6 +57,21 @@ extension SplashViewModel { } extension SplashViewModel { + private func checkForceUpdate() { + Task { + do { + if try await checkForceUpdateUseCase.execute() { + forceUpdateSubject.send(true) + ByeBooLogger.debug("강제 업데이트 필요") + } else { + forceUpdateSubject.send(false) + } + } catch { + forceUpdateSubject.send(false) + } + } + } + private func autoLogin() { ByeBooLogger.debug("자동로그인 실행") Task { From 032a20195e5873bc21d7327a085e1584731c268b Mon Sep 17 00:00:00 2001 From: yeonee Date: Sat, 4 Jul 2026 02:10:29 +0900 Subject: [PATCH 6/8] =?UTF-8?q?chore:=20#470=20throws=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/Persistence/Service/ForceUpdateManager.swift | 4 ++-- .../ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift b/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift index 35c31a9c..67030d94 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift @@ -8,7 +8,7 @@ import FirebaseRemoteConfig protocol ForceUpdateManager { - func checkForUpdate() async throws-> Bool + func checkForUpdate() async -> Bool } final class DefaultForceUpdateManager: ForceUpdateManager { @@ -20,7 +20,7 @@ final class DefaultForceUpdateManager: ForceUpdateManager { RemoteConfig.remoteConfig().configSettings = settings } - func checkForUpdate() async throws -> Bool { + func checkForUpdate() async -> Bool { do { try await remoteConfig.fetch() try await remoteConfig.activate() diff --git a/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift b/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift index e7745234..ad0f6d59 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift @@ -8,7 +8,7 @@ import Foundation protocol CheckForceUpdateUseCase { - func execute() async throws -> Bool + func execute() async -> Bool } struct DefaultCheckForceUpdateUsecase: CheckForceUpdateUseCase { @@ -19,7 +19,7 @@ struct DefaultCheckForceUpdateUsecase: CheckForceUpdateUseCase { self.repository = repository } - func execute() async throws -> Bool { - return try await repository.checkForUpdate() + func execute() async -> Bool { + return await repository.checkForUpdate() } } From 716c99614b58ebf509195fd2239dc4098cab435c Mon Sep 17 00:00:00 2001 From: yeonee Date: Sun, 5 Jul 2026 19:35:48 +0900 Subject: [PATCH 7/8] =?UTF-8?q?refactor:=20#470=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/Persistence/Service/ForceUpdateManager.swift | 6 +----- .../Domain/Interface/ForeceUpdateInterface.swift | 10 ++++++++++ .../Login/ViewController/SplashViewController.swift | 3 ++- .../Feature/Login/ViewModel/SplashViewModel.swift | 4 +--- 4 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/ForeceUpdateInterface.swift diff --git a/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift b/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift index 67030d94..20f144bd 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Data/Persistence/Service/ForceUpdateManager.swift @@ -7,11 +7,7 @@ import FirebaseRemoteConfig -protocol ForceUpdateManager { - func checkForUpdate() async -> Bool -} - -final class DefaultForceUpdateManager: ForceUpdateManager { +final class DefaultForceUpdateRepository: ForceUpdateInterface { let remoteConfig = RemoteConfig.remoteConfig() init() { diff --git a/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/ForeceUpdateInterface.swift b/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/ForeceUpdateInterface.swift new file mode 100644 index 00000000..9e0cc6ac --- /dev/null +++ b/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/ForeceUpdateInterface.swift @@ -0,0 +1,10 @@ +// +// ForeceUpdateInterface.swift +// ByeBoo-iOS +// +// Created by 이나연 on 7/5/26. +// + +protocol ForceUpdateInterface { + func checkForUpdate() async -> Bool +} diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewController/SplashViewController.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewController/SplashViewController.swift index 44dc49db..9867b4c3 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewController/SplashViewController.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewController/SplashViewController.swift @@ -54,7 +54,8 @@ extension SplashViewController { private func bindCheckForceUpdate() { viewModel.output.forceUpdatePublisher .receive(on: DispatchQueue.main) - .sink { result in + .sink { [weak self] result in + guard let self else { return } switch result { case true: self.presentForceUpdateModal() diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewModel/SplashViewModel.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewModel/SplashViewModel.swift index 27d0b3c2..0b387e67 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewModel/SplashViewModel.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Login/ViewModel/SplashViewModel.swift @@ -60,14 +60,12 @@ extension SplashViewModel { private func checkForceUpdate() { Task { do { - if try await checkForceUpdateUseCase.execute() { + if await checkForceUpdateUseCase.execute() { forceUpdateSubject.send(true) ByeBooLogger.debug("강제 업데이트 필요") } else { forceUpdateSubject.send(false) } - } catch { - forceUpdateSubject.send(false) } } } From bfe9b52da8ab3e095906183f95607a6a41fb1d40 Mon Sep 17 00:00:00 2001 From: yeonee Date: Mon, 6 Jul 2026 00:36:28 +0900 Subject: [PATCH 8/8] =?UTF-8?q?fix:=20#470=20=EB=B9=8C=EB=93=9C=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift | 2 +- .../ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift b/ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift index caecb078..076b68bf 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Domain/DomainDependencyAssembler.swift @@ -257,7 +257,7 @@ struct DomainDependencyAssembler: DependencyAssembler { } DIContainer.shared.register(type: CheckForceUpdateUseCase.self) { _ in - return DefaultCheckForceUpdateUsecase(repository: DefaultForceUpdateManager()) + return DefaultCheckForceUpdateUsecase(repository: DefaultForceUpdateRepository()) } } } diff --git a/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift b/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift index ad0f6d59..d9838484 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Domain/UseCase/CheckForceUpdateUseCase.swift @@ -13,9 +13,9 @@ protocol CheckForceUpdateUseCase { struct DefaultCheckForceUpdateUsecase: CheckForceUpdateUseCase { - private let repository: ForceUpdateManager + private let repository: ForceUpdateInterface - init(repository: ForceUpdateManager) { + init(repository: ForceUpdateInterface) { self.repository = repository }