@@ -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
0 commit comments