From 2d3b9d3e826fec9558279398412e5c11aadd265b Mon Sep 17 00:00:00 2001 From: Peter Csajtai Date: Mon, 17 Oct 2022 19:42:13 +0200 Subject: [PATCH] Do not start auto poll when the SDK is initialized in offline mode --- ConfigCat.podspec | 2 +- ConfigCat.xcconfig | 2 +- README.md | 2 +- Sources/ConfigCat/ConfigService.swift | 5 ++++- Sources/ConfigCat/Utils.swift | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ConfigCat.podspec b/ConfigCat.podspec index 8dba389..993a879 100755 --- a/ConfigCat.podspec +++ b/ConfigCat.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |spec| spec.name = "ConfigCat" - spec.version = "9.1.0" + spec.version = "9.1.1" spec.summary = "ConfigCat Swift SDK" spec.swift_version = "4.2" diff --git a/ConfigCat.xcconfig b/ConfigCat.xcconfig index bc310ab..a0ab586 100644 --- a/ConfigCat.xcconfig +++ b/ConfigCat.xcconfig @@ -47,4 +47,4 @@ SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator app SWIFT_VERSION = 4.2 // ConfigCat SDK version -MARKETING_VERSION = 9.1.0 +MARKETING_VERSION = 9.1.1 diff --git a/README.md b/README.md index 89f57a0..f88274d 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If you want to use ConfigCat in a [SwiftPM](https://swift.org/package-manager/) ``` swift dependencies: [ - .package(url: "https://github.com/configcat/swift-sdk", from: "9.1.0") + .package(url: "https://github.com/configcat/swift-sdk", from: "9.1.1") ] ``` diff --git a/Sources/ConfigCat/ConfigService.swift b/Sources/ConfigCat/ConfigService.swift index 6d697db..6815084 100644 --- a/Sources/ConfigCat/ConfigService.swift +++ b/Sources/ConfigCat/ConfigService.swift @@ -53,7 +53,10 @@ class ConfigService { if let autoPoll = pollingMode as? AutoPollingMode { initialized = false - startPoll(mode: autoPoll) + + if !offline { + startPoll(mode: autoPoll) + } // Waiting for the client initialization. // After the maxInitWaitTimeInSeconds timeout the client will be initialized and while the config is not ready diff --git a/Sources/ConfigCat/Utils.swift b/Sources/ConfigCat/Utils.swift index b422c75..9b60667 100644 --- a/Sources/ConfigCat/Utils.swift +++ b/Sources/ConfigCat/Utils.swift @@ -38,7 +38,7 @@ extension Date { } class Constants { - static let version: String = "9.1.0" + static let version: String = "9.1.1" static let configJsonName: String = "config_v5" static let globalBaseUrl: String = "https://cdn-global.configcat.com" static let euOnlyBaseUrl: String = "https://cdn-eu.configcat.com"