Skip to content

Releases: configcat/swift-sdk

v9.2.3

28 Oct 23:36
Compare
Choose a tag to compare

Fixed

  • A bug where calling close() on an already closed instance could remove an other instance from the singleton map that was created with the same SDK key.
  • Added missing methods to ConfigCatClientProtocol.

v9.2.2

19 Oct 01:38
Compare
Choose a tag to compare

Fixed

  • Exposed missing types and functions to Objective-C.

v9.2.1

18 Oct 21:28
Compare
Choose a tag to compare

Added

  • New factory method which accepts a configuration callback.
    let client = ConfigCatClient.get(sdkKey: "<sdkKey>") { options in 
        options.pollingMode = PollingModes.autoPoll()
    }

v9.2.0

18 Oct 18:59
Compare
Choose a tag to compare

Changed

  • Renamed: ClientOptions -> ConfigCatOptions, options.refreshMode -> options.pollingMode

v9.1.2

18 Oct 10:56
Compare
Choose a tag to compare

Fixed

  • Client factory (ConfigCatClient.get()) method did not produce truly single instances/sdk-key.

v9.1.1

17 Oct 17:53
Compare
Choose a tag to compare

Fixed

  • Prevent auto-poll from starting when the SDK is initialized in offline mode.

v9.1.0

14 Oct 10:42
Compare
Choose a tag to compare

Added

  • setDefaultUser(user) / clearDefaultUser() methods to set / remove a default user object used when there's no user passed to getValue() / getValueDetails() / getAllValues() / getAllVariationIds() methods.
  • setOffline() / setOnline() methods to indicate whether the SDK is allowed to make HTTP calls or not. In 'offline' mode the SDK works from the cache only.
  • onClientReady() / onConfigChanged([String: Setting]) / onFlagEvaluated(EvaluationDetails) / onError(String) hooks. Subscription is possible on client initialization options and on the hooks property of ConfigCatClient.
  • getValueDetails() method to retrieve evaluation details along with the feature flag / setting value. It returns the same details that is passed to onFlagEvaluated(EvaluationDetails) on each evaluation.
  • forceRefresh() method that returns with a result object to indicate whether the refresh succeeded or not.
  • ConfigCatClient.get() factory method that produces a single instance / SDK key.

Changed

  • Client initialization options were moved to a ClientOptions object that can be passed to the new ConfigCatClient.get() factory method.
  • ConfigCatClient can be explicitly closed via client.close() and ConfigCatClient.closeAll() methods.
  • The TTL of lazyLoad and interval of autoPoll is compared against a cached fetchTime, which allows the SDK not necessarily download a new config.json at each application restart.

v9.0.1

29 Jul 14:51
Compare
Choose a tag to compare

v9.0.0

28 Jul 10:30
6224cae
Compare
Choose a tag to compare

Fixed #24 by eliminating the Async & AsyncResult usage.

After further investigation, it turned out we used a dangerous method to force the underlying asynchronous operations behind a synchronous API. Therefore the Protocol now only supports asynchronous usage with async/await and completion callbacks.

Synchronous methods are still available as ConfigCatClient extensions to support scenarios where they are really needed. Be aware that they are using DispatchSemaphore to force synchronous execution.

Breaking changes

  • Protocol methods were renamed.
    • Completion callback API:
      func getValue<Value>(for key: String, defaultValue: Value, user: ConfigCatUser?, completion: @escaping (Value) -> ())
      
      func getVariationId(for key: String, defaultVariationId: String?, user: ConfigCatUser?, completion: @escaping (String?) -> ())
      func getKeyAndValue(for variationId: String, completion: @escaping (KeyValue?) -> ())
      
      func getAllKeys(completion: @escaping ([String]) -> ())
      func getAllValues(user: ConfigCatUser?, completion: @escaping ([String: Any]) -> ())
      func getAllVariationIds(user: ConfigCatUser?, completion: @escaping ([String]) -> ())
      
      func refresh(completion: @escaping () -> ())
    • Async/await API:
      func getValue<Value>(for key: String, defaultValue: Value, user: ConfigCatUser?) async -> Value
      
      func getVariationId(for key: String, defaultVariationId: String?, user: ConfigCatUser?) async -> String?
      func getKeyAndValue(for variationId: String) async -> KeyValue?
      
      func getAllVariationIds(user: ConfigCatUser?) async -> [String]
      func getAllKeys() async -> [String]
      func getAllValues(user: ConfigCatUser?) async -> [String: Any]
      
      func refresh() async
  • Synchronous API is not part of the Protocol anymore but it's available as ConfigCatClient extension:
    func getValueSync<Value>(for key: String, defaultValue: Value, user: ConfigCatUser? = nil) -> Value
    
    func getVariationIdSync(for key: String, defaultVariationId: String?, user: ConfigCatUser? = nil) -> String?
    func getKeyAndValueSync(for variationId: String) -> KeyValue?
    
    func getAllVariationIdsSync(user: ConfigCatUser? = nil) -> [String]
    func getAllKeysSync() -> [String]
    func getAllValuesSync(user: ConfigCatUser? = nil) -> [String: Any]
    
    func refreshSync()
  • The useAsyncRefresh parameter of PollingModes.lazyLoad() was removed. Its purpose of letting the user not wait for an asynchronous HTTP call became meaningless. Its name was also misleading.

v8.0.1

21 Mar 17:07
a055722
Compare
Choose a tag to compare
  • Fix the sdkKey in the iOS sample app.
  • Fix targeting and percentage rule handling in getKeyAndValue.
  • Make KeyValue class members public.