Skip to content

Commit 92b0a7c

Browse files
NMC 2575 - App update changes
1 parent 311c686 commit 92b0a7c

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

iOSClient/AppUpdate/AppUpdater.swift

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,29 @@ class AppUpdater {
6262
if status == .success {
6363
remoteConfig.activate { value, error in
6464
// Remote config values fetched successfully
65-
let iOSVersion = remoteConfig["ios_app_version"].stringValue ?? "default_value"
65+
let iOSVersionString = remoteConfig["ios_app_version"].stringValue ?? "default_value"
6666
let isForcheUpdate = remoteConfig["ios_force_update"].boolValue
67-
if let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
67+
if let currentVersionString = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String,
68+
let currentVersion = Int(currentVersionString.replacingOccurrences(of: ".", with: "")),
69+
let iOSVersion = Int(iOSVersionString.replacingOccurrences(of: ".", with: "")) {
70+
// if let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
6871
if iOSVersion != currentVersion {
6972
// There is an update available
70-
completion(iOSVersion,isForcheUpdate)
73+
completion(iOSVersionString,isForcheUpdate)
7174
} else {
7275
completion(nil, nil)
7376
}
7477
}
78+
// let iOSVersion = remoteConfig["ios_app_version"].stringValue ?? "default_value"
79+
// let isForcheUpdate = remoteConfig["ios_force_update"].boolValue
80+
// if let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
81+
// if iOSVersion != currentVersion {
82+
// // There is an update available
83+
// completion(iOSVersion,isForcheUpdate)
84+
// } else {
85+
// completion(nil, nil)
86+
// }
87+
// }
7588
}
7689
} else {
7790
// Handle error

iOSClient/SceneDelegate.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
542542
}
543543

544544
private func showPrivacyProtectionWindow() {
545+
guard privacyProtectionWindow == nil else {
546+
privacyProtectionWindow?.isHidden = false
547+
return
548+
}
545549
guard let windowScene = self.window?.windowScene else {
546550
return
547551
}

0 commit comments

Comments
 (0)