Skip to content

Commit

Permalink
[Feat] #176 - 강제 업데이트 로직 추가
Browse files Browse the repository at this point in the history
[Feat] #176 - 강제 업데이트 로직 추가
  • Loading branch information
yungu0010 authored Jul 23, 2024
2 parents 3e99cd9 + 27a7cd0 commit e183479
Show file tree
Hide file tree
Showing 14 changed files with 297 additions and 50 deletions.
105 changes: 78 additions & 27 deletions pophory-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@
37ED8E522A8E6F9E002D6F07 /* PostRefreshTokenDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37ED8E512A8E6F9E002D6F07 /* PostRefreshTokenDTO.swift */; };
3B149AB82C4D1EF500F1832B /* Bundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B149AB72C4D1EF500F1832B /* Bundle.swift */; };
3B149ABA2C4D4B2C00F1832B /* RootViewSwitcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B149AB92C4D4B2C00F1832B /* RootViewSwitcher.swift */; };
3B15D0E42A9627940007E330 /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 3B15D0E32A9627940007E330 /* Moya */; };
3B15D0E72A9627F40007E330 /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = 3B15D0E62A9627F40007E330 /* Sentry */; };
3B1E30F22C4EA60200E019D9 /* FirebaseService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B1E30F12C4EA60200E019D9 /* FirebaseService.swift */; };
3B1E30F52C4EA85800E019D9 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 3B1E30F42C4EA85800E019D9 /* FirebaseAnalytics */; };
3B1E30F72C4EA85800E019D9 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 3B1E30F62C4EA85800E019D9 /* FirebaseCrashlytics */; };
3B1E30F92C4EA85800E019D9 /* FirebaseDynamicLinks in Frameworks */ = {isa = PBXBuildFile; productRef = 3B1E30F82C4EA85800E019D9 /* FirebaseDynamicLinks */; };
3B1E30FB2C4EA85800E019D9 /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = 3B1E30FA2C4EA85800E019D9 /* FirebaseRemoteConfig */; };
3B1E31022C4FC57400E019D9 /* SplashViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B1E31012C4FC57400E019D9 /* SplashViewController.swift */; };
3B1E31062C4FDC4C00E019D9 /* SplashView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B1E31052C4FDC4C00E019D9 /* SplashView.swift */; };
3B218EA72B833FA0006959E3 /* AuthInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B218EA62B833FA0006959E3 /* AuthInterceptor.swift */; };
3B3A09132A56A56F00C8A740 /* PhotoDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B3A09122A56A56F00C8A740 /* PhotoDetailView.swift */; };
3B3A09152A56A6C700C8A740 /* PhotoDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B3A09142A56A6C700C8A740 /* PhotoDetailViewController.swift */; };
Expand All @@ -82,13 +87,11 @@
3BC03E902AEB902F006CF499 /* WebViewURLList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BC03E8F2AEB902F006CF499 /* WebViewURLList.swift */; };
3BD441AA2BEB4CD400DC0F3B /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441A92BEB4CD400DC0F3B /* Kingfisher */; };
3BD441AC2BEB4CDA00DC0F3B /* GoogleMobileAds in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441AB2BEB4CDA00DC0F3B /* GoogleMobileAds */; };
3BD441AE2BEB4CEE00DC0F3B /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441AD2BEB4CEE00DC0F3B /* FirebaseAnalytics */; };
3BD441B02BEB4CFA00DC0F3B /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441AF2BEB4CFA00DC0F3B /* Moya */; };
3BD441B22BEB4D0000DC0F3B /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441B12BEB4D0000DC0F3B /* SnapKit */; };
3BD441B42BEB4D0900DC0F3B /* SkeletonView in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441B32BEB4D0900DC0F3B /* SkeletonView */; };
3BD441B62BEB4D7600DC0F3B /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441B52BEB4D7600DC0F3B /* RxSwift */; };
3BD441B82BEB4DB200DC0F3B /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441B72BEB4DB200DC0F3B /* Sentry */; };
3BD441BA2BEB4DF100DC0F3B /* FirebaseDynamicLinks in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441B92BEB4DF100DC0F3B /* FirebaseDynamicLinks */; };
3BD441BC2BEB4E1300DC0F3B /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD441BB2BEB4E1300DC0F3B /* RxCocoa */; };
6B05C56D2AC4277800A75C00 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B05C56C2AC4277800A75C00 /* ShareViewController.swift */; };
6B05C5702AC4277800A75C00 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6B05C56E2AC4277800A75C00 /* MainInterface.storyboard */; };
Expand Down Expand Up @@ -305,6 +308,9 @@
3B0DB5AE2B87BBFE00665FE7 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
3B149AB72C4D1EF500F1832B /* Bundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bundle.swift; sourceTree = "<group>"; };
3B149AB92C4D4B2C00F1832B /* RootViewSwitcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootViewSwitcher.swift; sourceTree = "<group>"; };
3B1E30F12C4EA60200E019D9 /* FirebaseService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseService.swift; sourceTree = "<group>"; };
3B1E31012C4FC57400E019D9 /* SplashViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashViewController.swift; sourceTree = "<group>"; };
3B1E31052C4FDC4C00E019D9 /* SplashView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = SplashView.swift; path = "pophory-iOS/Screen/Splash/View/SplashView.swift"; sourceTree = SOURCE_ROOT; };
3B218EA62B833FA0006959E3 /* AuthInterceptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthInterceptor.swift; sourceTree = "<group>"; };
3B3A09122A56A56F00C8A740 /* PhotoDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoDetailView.swift; sourceTree = "<group>"; };
3B3A09142A56A6C700C8A740 /* PhotoDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoDetailViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -450,17 +456,19 @@
buildActionMask = 2147483647;
files = (
3BD441B62BEB4D7600DC0F3B /* RxSwift in Frameworks */,
3BD441BA2BEB4DF100DC0F3B /* FirebaseDynamicLinks in Frameworks */,
3BD441AC2BEB4CDA00DC0F3B /* GoogleMobileAds in Frameworks */,
3BD441AA2BEB4CD400DC0F3B /* Kingfisher in Frameworks */,
3B1E30FB2C4EA85800E019D9 /* FirebaseRemoteConfig in Frameworks */,
3BD441B02BEB4CFA00DC0F3B /* Moya in Frameworks */,
3BD441B22BEB4D0000DC0F3B /* SnapKit in Frameworks */,
3BD441BC2BEB4E1300DC0F3B /* RxCocoa in Frameworks */,
3B1E30F52C4EA85800E019D9 /* FirebaseAnalytics in Frameworks */,
3BD441B82BEB4DB200DC0F3B /* Sentry in Frameworks */,
3BD441B42BEB4D0900DC0F3B /* SkeletonView in Frameworks */,
3B1E30F72C4EA85800E019D9 /* FirebaseCrashlytics in Frameworks */,
3B6F26182AC9DBF70065C2C5 /* AppTrackingTransparency.framework in Frameworks */,
3BD441AE2BEB4CEE00DC0F3B /* FirebaseAnalytics in Frameworks */,
6B5EF4E62A9122D100D20E04 /* (null) in Frameworks */,
3B1E30F92C4EA85800E019D9 /* FirebaseDynamicLinks in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -734,6 +742,32 @@
path = Configuration;
sourceTree = "<group>";
};
3B1E30FE2C4FC53000E019D9 /* Splash */ = {
isa = PBXGroup;
children = (
3B1E31002C4FC56600E019D9 /* ViewController */,
3B1E30FF2C4FC55F00E019D9 /* View */,
);
path = Splash;
sourceTree = "<group>";
};
3B1E30FF2C4FC55F00E019D9 /* View */ = {
isa = PBXGroup;
children = (
3B1E31052C4FDC4C00E019D9 /* SplashView.swift */,
);
name = View;
path = "퍋ㅈ";
sourceTree = "<group>";
};
3B1E31002C4FC56600E019D9 /* ViewController */ = {
isa = PBXGroup;
children = (
3B1E31012C4FC57400E019D9 /* SplashViewController.swift */,
);
path = ViewController;
sourceTree = "<group>";
};
3B218EA52B833F85006959E3 /* Interceptor */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1167,6 +1201,7 @@
B1631F3B2A175B290050974F /* Screen */ = {
isa = PBXGroup;
children = (
3B1E30FE2C4FC53000E019D9 /* Splash */,
37E036DE2AD298F9004E179A /* PhotoUpload */,
37E036D52ACFFD4A004E179A /* QRDownload */,
37E036D42ACFFD0D004E179A /* QRScanner */,
Expand Down Expand Up @@ -1232,6 +1267,7 @@
3B0DB5AD2B87BBE500665FE7 /* Release */,
3B0DB5AC2B87BBD500665FE7 /* Debug */,
B1631F182A1759EB0050974F /* Info.plist */,
3B1E30F12C4EA60200E019D9 /* FirebaseService.swift */,
);
path = Firebase;
sourceTree = "<group>";
Expand Down Expand Up @@ -1360,14 +1396,16 @@
packageProductDependencies = (
3BD441A92BEB4CD400DC0F3B /* Kingfisher */,
3BD441AB2BEB4CDA00DC0F3B /* GoogleMobileAds */,
3BD441AD2BEB4CEE00DC0F3B /* FirebaseAnalytics */,
3BD441AF2BEB4CFA00DC0F3B /* Moya */,
3BD441B12BEB4D0000DC0F3B /* SnapKit */,
3BD441B32BEB4D0900DC0F3B /* SkeletonView */,
3BD441B52BEB4D7600DC0F3B /* RxSwift */,
3BD441B72BEB4DB200DC0F3B /* Sentry */,
3BD441B92BEB4DF100DC0F3B /* FirebaseDynamicLinks */,
3BD441BB2BEB4E1300DC0F3B /* RxCocoa */,
3B1E30F42C4EA85800E019D9 /* FirebaseAnalytics */,
3B1E30F62C4EA85800E019D9 /* FirebaseCrashlytics */,
3B1E30F82C4EA85800E019D9 /* FirebaseDynamicLinks */,
3B1E30FA2C4EA85800E019D9 /* FirebaseRemoteConfig */,
);
productName = ZKFace;
productReference = B1631F072A1759EA0050974F /* pophory-iOS.app */;
Expand Down Expand Up @@ -1449,11 +1487,11 @@
3BE3FABB2BE38D9800CF61A1 /* XCRemoteSwiftPackageReference "Kingfisher" */,
3BE3FABC2BE38DDE00CF61A1 /* XCRemoteSwiftPackageReference "swift-package-manager-google-mobile-ads" */,
3BE3FABD2BE38DF000CF61A1 /* XCRemoteSwiftPackageReference "RxSwift" */,
3BE3FABE2BE38E1500CF61A1 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
3BE3FABF2BE38E5000CF61A1 /* XCRemoteSwiftPackageReference "sentry-cocoa" */,
3BE3FAC02BE38E8500CF61A1 /* XCRemoteSwiftPackageReference "Moya" */,
3BE3FAC22BE38EA400CF61A1 /* XCRemoteSwiftPackageReference "SkeletonView" */,
3B7CC3BE2BE38F9800CFC2C7 /* XCRemoteSwiftPackageReference "SnapKit" */,
3B1E30F32C4EA85800E019D9 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
);
productRefGroup = B1631F082A1759EA0050974F /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -1581,6 +1619,7 @@
B138A3B82A586EC3000EE81E /* SettingsRootView.swift in Sources */,
377EF7E72A4F4C8700E3268D /* NameInputView.swift in Sources */,
B1631F542A175F090050974F /* UIImageView+Extension.swift in Sources */,
3B1E31022C4FC57400E019D9 /* SplashViewController.swift in Sources */,
377EF7EF2A4FC6E900E3268D /* PophoryNavigationConfigurator.swift in Sources */,
3B583A5F2AF0288F008FFB9A /* AdAPI.swift in Sources */,
B1631F502A175E840050974F /* String+Extension.swift in Sources */,
Expand Down Expand Up @@ -1642,6 +1681,7 @@
91F3A7792A52AC3E00C06D1B /* Photos.swift in Sources */,
3782F4402A52C6EB00FE3846 /* BaseInputView.swift in Sources */,
37E036E02AD29936004E179A /* PhotoUploadModalViewController.swift in Sources */,
3B1E30F22C4EA60200E019D9 /* FirebaseService.swift in Sources */,
377EF7E02A4F489B00E3268D /* IDInputViewController.swift in Sources */,
37ABA3472A7FA08400201A39 /* AsyncMoyaProvider.swift in Sources */,
6BCE47602A684FDB0060EC78 /* ShareRepository.swift in Sources */,
Expand Down Expand Up @@ -1722,6 +1762,7 @@
37310F142A5535B20046E777 /* PickAlbumButtonCollectionViewCell.swift in Sources */,
3782F4322A51E6D200FE3846 /* KeyboardManager.swift in Sources */,
6B5EF4E32A8FF87600D20E04 /* UIImage+Extension.swift in Sources */,
3B1E31062C4FDC4C00E019D9 /* SplashView.swift in Sources */,
9127800E2A67BF510005BBA3 /* EditAlbumViewController.swift in Sources */,
3782F4462A52F4BF00FE3846 /* OnboardingContentCollectionViewCell.swift in Sources */,
B1F310EB2A629B1600BF989B /* PopupType.swift in Sources */,
Expand Down Expand Up @@ -2245,6 +2286,14 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
3B1E30F32C4EA85800E019D9 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 10.29.0;
};
};
3B7CC3BE2BE38F9800CFC2C7 /* XCRemoteSwiftPackageReference "SnapKit" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/SnapKit/SnapKit";
Expand Down Expand Up @@ -2277,14 +2326,6 @@
minimumVersion = 6.7.1;
};
};
3BE3FABE2BE38E1500CF61A1 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 10.25.0;
};
};
3BE3FABF2BE38E5000CF61A1 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/getsentry/sentry-cocoa";
Expand Down Expand Up @@ -2312,6 +2353,26 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
3B1E30F42C4EA85800E019D9 /* FirebaseAnalytics */ = {
isa = XCSwiftPackageProductDependency;
package = 3B1E30F32C4EA85800E019D9 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAnalytics;
};
3B1E30F62C4EA85800E019D9 /* FirebaseCrashlytics */ = {
isa = XCSwiftPackageProductDependency;
package = 3B1E30F32C4EA85800E019D9 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseCrashlytics;
};
3B1E30F82C4EA85800E019D9 /* FirebaseDynamicLinks */ = {
isa = XCSwiftPackageProductDependency;
package = 3B1E30F32C4EA85800E019D9 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseDynamicLinks;
};
3B1E30FA2C4EA85800E019D9 /* FirebaseRemoteConfig */ = {
isa = XCSwiftPackageProductDependency;
package = 3B1E30F32C4EA85800E019D9 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseRemoteConfig;
};
3BD441A92BEB4CD400DC0F3B /* Kingfisher */ = {
isa = XCSwiftPackageProductDependency;
package = 3BE3FABB2BE38D9800CF61A1 /* XCRemoteSwiftPackageReference "Kingfisher" */;
Expand All @@ -2322,11 +2383,6 @@
package = 3BE3FABC2BE38DDE00CF61A1 /* XCRemoteSwiftPackageReference "swift-package-manager-google-mobile-ads" */;
productName = GoogleMobileAds;
};
3BD441AD2BEB4CEE00DC0F3B /* FirebaseAnalytics */ = {
isa = XCSwiftPackageProductDependency;
package = 3BE3FABE2BE38E1500CF61A1 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAnalytics;
};
3BD441AF2BEB4CFA00DC0F3B /* Moya */ = {
isa = XCSwiftPackageProductDependency;
package = 3BE3FAC02BE38E8500CF61A1 /* XCRemoteSwiftPackageReference "Moya" */;
Expand All @@ -2352,11 +2408,6 @@
package = 3BE3FABF2BE38E5000CF61A1 /* XCRemoteSwiftPackageReference "sentry-cocoa" */;
productName = Sentry;
};
3BD441B92BEB4DF100DC0F3B /* FirebaseDynamicLinks */ = {
isa = XCSwiftPackageProductDependency;
package = 3BE3FABE2BE38E1500CF61A1 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseDynamicLinks;
};
3BD441BB2BEB4E1300DC0F3B /* RxCocoa */ = {
isa = XCSwiftPackageProductDependency;
package = 3BE3FABD2BE38DF000CF61A1 /* XCRemoteSwiftPackageReference "RxSwift" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "97940381e57703c07f31a8058d8f39ec53b7c272",
"version" : "10.25.0"
"revision" : "eca84fd638116dd6adb633b5a3f31cc7befcbb7d",
"version" : "10.29.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "16244d177c4e989f87b25e9db1012b382cfedc55",
"version" : "10.25.0"
"revision" : "fe727587518729046fc1465625b9afd80b5ab361",
"version" : "10.28.0"
}
},
{
Expand Down Expand Up @@ -147,7 +147,7 @@
{
"identity" : "rxswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveX/RxSwift",
"location" : "https://github.com/ReactiveX/RxSwift.git",
"state" : {
"revision" : "b06a8c8596e4c3e8e7788e08e720e3248563ce6a",
"version" : "6.7.1"
Expand All @@ -165,7 +165,7 @@
{
"identity" : "skeletonview",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Juanpe/SkeletonView",
"location" : "https://github.com/Juanpe/SkeletonView.git",
"state" : {
"revision" : "2f5274827d310e32c09325dd3e0007120940988e",
"version" : "1.31.0"
Expand All @@ -174,7 +174,7 @@
{
"identity" : "snapkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SnapKit/SnapKit",
"location" : "https://github.com/SnapKit/SnapKit.git",
"state" : {
"revision" : "2842e6e84e82eb9a8dac0100ca90d9444b0307f4",
"version" : "5.7.1"
Expand All @@ -185,8 +185,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/googleads/swift-package-manager-google-mobile-ads",
"state" : {
"revision" : "70516c9e799a366ff90c1a70c09c48f7c076fd8a",
"version" : "10.14.0"
"revision" : "6457f9651bea0d62a548ac63fa9d34aae7d0488e",
"version" : "11.7.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
10 changes: 10 additions & 0 deletions pophory-iOS/Configuration/Bundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ enum Config: String {
case baseURL = "BASE_URL"
case sentryDNS = "SENTRY_DSN"
case unitADId = "UNIT_AD_ID"
case appVersion = "CFBundleShortVersionString"
case appId = "APP_ID"
}

extension Bundle {
Expand Down Expand Up @@ -48,4 +50,12 @@ extension Bundle {
static var unitAdID: String {
return getString(forKey: Config.unitADId.rawValue)
}

static var appVersion: String {
return getString(forKey: Config.appVersion.rawValue)
}

static var appId: String {
return getString(forKey: Config.appId.rawValue)
}
}
51 changes: 51 additions & 0 deletions pophory-iOS/Firebase/FirebaseService.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// FirebaseService.swift
// pophory-iOS
//
// Created by 강윤서 on 7/22/24.
//

import Firebase
import FirebaseRemoteConfig

final class FirebaseService {
static let shared = FirebaseService()

private let config = RemoteConfig.remoteConfig()

enum RemoteConfigType: String {
case minimumVersion = "minimum_update_version_iOS"
}

private init() {
self.setRemoteConfigSetting()
}
}

extension FirebaseService {
private func setRemoteConfigSetting() {
let setting = RemoteConfigSettings()
setting.minimumFetchInterval = 0
setting.fetchTimeout = 1
config.configSettings = setting
}

func fetchRemoteConfig(type: RemoteConfigType) async -> String? {
return await withCheckedContinuation { continuation in
config.fetch { status, error in
if status == .success {
self.config.activate { change, error in
guard let version = self.config[type.rawValue].stringValue,
!version.isEmpty else {
continuation.resume(returning: nil)
return
}
continuation.resume(returning: version)
}
} else {
continuation.resume(returning: nil)
}
}
}
}
}
Loading

0 comments on commit e183479

Please sign in to comment.