Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Runnect-iOS/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ target 'Runnect-iOS' do
pod 'FirebaseAnalytics'
pod 'FirebaseAuth'
pod 'FirebaseFirestore'

pod 'Firebase/RemoteConfig'


end
Expand Down
8 changes: 4 additions & 4 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
232686362B03AF4400675A17 /* NetworkProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 232686352B03AF4400675A17 /* NetworkProvider.swift */; };
23628DDE2B6BCB9C00894B18 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 23628DDD2B6BCB9C00894B18 /* GoogleService-Info.plist */; };
23EE06C12AC1AD5200CB3FF8 /* LocationSelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE06C02AC1AD5200CB3FF8 /* LocationSelectView.swift */; };
23EE06C52AC1AE1900CB3FF8 /* BaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE06C42AC1AE1900CB3FF8 /* BaseView.swift */; };
23EE06C92AC1DED100CB3FF8 /* GesturePublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE06C82AC1DED100CB3FF8 /* GesturePublisher.swift */; };
Expand All @@ -21,7 +22,6 @@
712DB0702B443ACC0013FD79 /* GAEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 712DB06F2B443ACC0013FD79 /* GAEvent.swift */; };
712F661D2A7B7BAB00D9539B /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = 712F661C2A7B7BAB00D9539B /* Config.swift */; };
7136BF8A2AF921A900679364 /* CustomBottomSheetVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7136BF892AF921A900679364 /* CustomBottomSheetVC.swift */; };
713A98F02B29DD9900189B3C /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 713A98EF2B29DD9900189B3C /* GoogleService-Info.plist */; };
715D36E82B2CC64000CAA9D6 /* MyUploadedCourseResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 715D36E72B2CC64000CAA9D6 /* MyUploadedCourseResponseDto.swift */; };
717916DA2B13613B009CEF97 /* MarathonListResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 717916D92B13613B009CEF97 /* MarathonListResponseDto.swift */; };
71802C5C2B3364C2008DBCEE /* CourseDetailScrapCountDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71802C5B2B3364C2008DBCEE /* CourseDetailScrapCountDto.swift */; };
Expand Down Expand Up @@ -180,6 +180,7 @@

/* Begin PBXFileReference section */
232686352B03AF4400675A17 /* NetworkProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProvider.swift; sourceTree = "<group>"; };
23628DDD2B6BCB9C00894B18 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
23EE06C02AC1AD5200CB3FF8 /* LocationSelectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationSelectView.swift; sourceTree = "<group>"; };
23EE06C42AC1AE1900CB3FF8 /* BaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseView.swift; sourceTree = "<group>"; };
23EE06C82AC1DED100CB3FF8 /* GesturePublisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GesturePublisher.swift; sourceTree = "<group>"; };
Expand All @@ -194,7 +195,6 @@
712DB06F2B443ACC0013FD79 /* GAEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GAEvent.swift; sourceTree = "<group>"; };
712F661C2A7B7BAB00D9539B /* Config.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = "<group>"; };
7136BF892AF921A900679364 /* CustomBottomSheetVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomBottomSheetVC.swift; sourceTree = "<group>"; };
713A98EF2B29DD9900189B3C /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
715D36E72B2CC64000CAA9D6 /* MyUploadedCourseResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyUploadedCourseResponseDto.swift; sourceTree = "<group>"; };
717916D92B13613B009CEF97 /* MarathonListResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarathonListResponseDto.swift; sourceTree = "<group>"; };
71802C5B2B3364C2008DBCEE /* CourseDetailScrapCountDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetailScrapCountDto.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -869,7 +869,7 @@
CE6655A9295D7FAA00C64E12 /* Network */,
CE6655A8295D7F7D00C64E12 /* Presentation */,
CE4545D6295D7AF5003201E1 /* Info.plist */,
713A98EF2B29DD9900189B3C /* GoogleService-Info.plist */,
23628DDD2B6BCB9C00894B18 /* GoogleService-Info.plist */,
);
path = "Runnect-iOS";
sourceTree = "<group>";
Expand Down Expand Up @@ -1334,7 +1334,7 @@
files = (
CE665615295D989A00C64E12 /* .swiftlint.yml in Resources */,
CE17F0342961BEF800E1DED0 /* Pretendard-Bold.otf in Resources */,
713A98F02B29DD9900189B3C /* GoogleService-Info.plist in Resources */,
23628DDE2B6BCB9C00894B18 /* GoogleService-Info.plist in Resources */,
CE17F0352961BEF800E1DED0 /* Pretendard-SemiBold.otf in Resources */,
CE17F0332961BEF800E1DED0 /* Pretendard-Medium.otf in Resources */,
CE6655BF295D82E200C64E12 /* .gitkeep in Resources */,
Expand Down
58 changes: 58 additions & 0 deletions Runnect-iOS/Runnect-iOS/Global/Supports/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import KakaoSDKCommon
import FirebaseCore
import FirebaseFirestore
import FirebaseAuth
import FirebaseRemoteConfig

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -38,6 +39,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

FirebaseApp.configure()
setRemoteConfig()

NMFAuthManager.shared().clientId = Config.naverMapClientId
KakaoSDK.initSDK(appKey: Config.kakaoNativeAppKey)

Expand All @@ -58,3 +61,58 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}

extension AppDelegate {
func setRemoteConfig() {
let remoteConfig = RemoteConfig.remoteConfig()
let settings = RemoteConfigSettings()

/// 개발 중에는 0으로 설정
settings.minimumFetchInterval = 86400 // 24hour
remoteConfig.configSettings = settings

remoteConfig.fetch() { (status, error) -> Void in
if status == .success {
remoteConfig.activate() { (changed, error) in
guard let info = Bundle.main.infoDictionary,
let currentVersion = info["CFBundleShortVersionString"] as? String,
let identifier = info["CFBundleIdentifier"] as? String,
let storeVersion = remoteConfig["iOS_current_market_version"].stringValue
else { return }

if currentVersion.compare(storeVersion, options: .numeric) == .orderedAscending {
self.showUpdateAlert()
}
}
} else {
print("Error: \(error?.localizedDescription ?? "No error available.")")
}
}
}

func showUpdateAlert() {
DispatchQueue.main.sync {
let alert = UIAlertController(
title: "업데이트 알림",
message: "새로운 기능이 추가된 'Runnect'의 최신 버전을 만나보세요!\n지금 바로 업데이트하고 개선된 사용자 경험을 즐겨보세요.",
preferredStyle: .alert
)

let updateAction = UIAlertAction(title: "업데이트 링크", style: .default) { _ in
let url = "itms-apps://itunes.apple.com/app/1663884202"
if let url = URL(string: url), UIApplication.shared.canOpenURL(url) {
if #available(iOS 13.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(url)
}
}
}

alert.addAction(updateAction)
if let vc = UIApplication.shared.keyWindow?.rootViewController {
vc.present(alert, animated: true, completion: nil)
}
}
}
}