-
Notifications
You must be signed in to change notification settings - Fork 0
feat: RemoteConfig를 통한 강제 업데이트 처리 분기 #264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d48b014
[BOOK-435] chore: remote config package 추가
doyeonk429 3212a3d
[BOOK-435] feat: appversion 관리 entity 추가 및 repo interface 정의
doyeonk429 f3cad22
[BOOK-435] feat: remoteConfig Repo 구현
doyeonk429 873ef7e
[BOOK-435] feat: FetchRemoteAppVersion usecase 설계, 구현 및 DI 처리
doyeonk429 672c8de
[BOOK-435] feat: assembly에 DI 추가
doyeonk429 77ba5ed
[BOOK-435] feat: AppCoordinator, SceneDelegate usecase 추가 및 분리 로직 정리
doyeonk429 07105bf
[BOOK-435] fix: release환경에서는 기본 값 12h를 사용하도록 수정
doyeonk429 f004f05
[BOOK-435] fix: 토끼 리뷰 반영
doyeonk429 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/Projects/BKData/Sources/Repository/DefaultRemoteConfigRepository.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // Copyright © 2025 Booket. All rights reserved | ||
|
|
||
| import BKDomain | ||
| import Combine | ||
| import Foundation | ||
| import FirebaseRemoteConfig | ||
|
|
||
| enum RemoteConfigKeys { | ||
| static let latestVersion = "appleLatestVersion" | ||
| static let minimumRequiredVersion = "appleMinimumVersion" | ||
| } | ||
|
|
||
| public struct DefaultRemoteConfigRepository: RemoteConfigRepository { | ||
|
|
||
| private let remoteConfig: RemoteConfig | ||
|
|
||
| public init(remoteConfig: RemoteConfig) { | ||
| self.remoteConfig = remoteConfig | ||
| self.setDefaults() | ||
| } | ||
|
|
||
| public func fetchRemoteAppVersions() -> AnyPublisher<RemoteAppVersion, Error> { | ||
| return Future<RemoteAppVersion, Error> { promise in | ||
| self.remoteConfig.fetchAndActivate { status, error in | ||
| if let error = error { | ||
| promise(.failure(error)) | ||
| return | ||
| } | ||
|
|
||
| if status != .error { | ||
| let latest = self.remoteConfig.configValue( | ||
| forKey: RemoteConfigKeys.latestVersion | ||
| ).stringValue | ||
|
|
||
| let minimum = self.remoteConfig.configValue( | ||
| forKey: RemoteConfigKeys.minimumRequiredVersion | ||
| ).stringValue | ||
|
|
||
| let versions = RemoteAppVersion( | ||
| latestVersion: latest, | ||
| minimumRequiredVersion: minimum | ||
| ) | ||
| promise(.success(versions)) | ||
| } else { | ||
| promise(.failure(URLError(.cannotParseResponse))) | ||
| } | ||
| } | ||
| } | ||
| .eraseToAnyPublisher() | ||
| } | ||
|
|
||
| private func setDefaults() { | ||
| let defaultValues: [String: NSObject] = [ | ||
| RemoteConfigKeys.latestVersion: "0.0.0" as NSObject, | ||
| RemoteConfigKeys.minimumRequiredVersion: "0.0.0" as NSObject | ||
| ] | ||
| self.remoteConfig.setDefaults(defaultValues) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Projects/BKDomain/Sources/Entity/RemoteAppVersion.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // Copyright © 2025 Booket. All rights reserved | ||
|
|
||
| import Foundation | ||
|
|
||
| public struct RemoteAppVersion { | ||
| public let latestVersion: String | ||
| public let minimumRequiredVersion: String | ||
|
|
||
| public init(latestVersion: String, minimumRequiredVersion: String) { | ||
| self.latestVersion = latestVersion | ||
| self.minimumRequiredVersion = minimumRequiredVersion | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
src/Projects/BKDomain/Sources/Interface/Repository/RemoteConfigRepository.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Copyright © 2025 Booket. All rights reserved | ||
|
|
||
| import Combine | ||
| import Foundation | ||
|
|
||
| public protocol RemoteConfigRepository { | ||
| func fetchRemoteAppVersions() -> AnyPublisher<RemoteAppVersion, Error> | ||
| } |
9 changes: 9 additions & 0 deletions
9
src/Projects/BKDomain/Sources/Interface/Usecase/FetchRemoteAppVersionUseCase.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // Copyright © 2025 Booket. All rights reserved | ||
|
|
||
| import Combine | ||
| import Foundation | ||
|
|
||
| /// Remote Config에서 앱 버전 정보(최신, 최소)를 가져옵니다. | ||
| public protocol FetchRemoteAppVersionUseCase { | ||
| func execute() -> AnyPublisher<RemoteAppVersion, Error> | ||
| } |
17 changes: 17 additions & 0 deletions
17
src/Projects/BKDomain/Sources/UseCase/DefaultFetchRemoteAppVersionUseCase.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // Copyright © 2025 Booket. All rights reserved | ||
|
|
||
| import Combine | ||
| import Foundation | ||
|
|
||
| public struct DefaultFetchRemoteAppVersionUseCase: FetchRemoteAppVersionUseCase { | ||
|
|
||
| private let repository: RemoteConfigRepository | ||
|
|
||
| public init(repository: RemoteConfigRepository) { | ||
| self.repository = repository | ||
| } | ||
|
|
||
| public func execute() -> AnyPublisher<RemoteAppVersion, Error> { | ||
| return repository.fetchRemoteAppVersions() | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.