Releases: configcat/swift-sdk
Releases · configcat/swift-sdk
v9.2.3
v9.2.2
v9.2.1
v9.2.0
v9.1.2
v9.1.1
v9.1.0
Added
setDefaultUser(user)
/clearDefaultUser()
methods to set / remove a default user object used when there's no user passed togetValue()
/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 thehooks
property ofConfigCatClient
.getValueDetails()
method to retrieve evaluation details along with the feature flag / setting value. It returns the same details that is passed toonFlagEvaluated(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 newConfigCatClient.get()
factory method. ConfigCatClient
can be explicitly closed viaclient.close()
andConfigCatClient.closeAll()
methods.- The TTL of
lazyLoad
and interval ofautoPoll
is compared against a cachedfetchTime
, which allows the SDK not necessarily download a newconfig.json
at each application restart.
v9.0.1
v9.0.0
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
- Completion callback API:
- 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 ofPollingModes.lazyLoad()
was removed. Its purpose of letting the user not wait for an asynchronous HTTP call became meaningless. Its name was also misleading.