Releases: configcat/swift-sdk
v11.3.0
Added
- When an external cache is configured, the SDK continues to sync with it in offline mode.
- Introduce new error codes for better error handling on
EvaluationDetailsandRefreshResults. - New hook subscriber methods that get a
ConfigCatClientSnapshotas parameter:addOnReady(snapshotHandler: @escaping (ConfigCatClientSnapshot) -> ()): Subscribers get a pre-built snapshot that is built from the initial state of the SDK.addOnConfigChanged(snapshotHandler: @escaping (Config, ConfigCatClientSnapshot) -> ()): Subscribers get a snapshot that is built from the newly fetched state of the SDK.
Changed
Some components (usually not directly referenced by type) were renamed:
ConfigCatSnapshot->ConfigCatClientSnapshotClientReadyState->ClientCacheState
v11.2.0
Fixed
- Fix crash in withCheckedContinuation on iOS 18.0 (thanks to @leoMehlig for the contribution)
v11.1.0
v11.0.3
v11.0.2
v11.0.1
v11.0.0
Added
- Support for the new Config JSON v6 format: updated the config model and implemented new features in setting evaluation logic.
- Ability to pass a custom logger (by conforming
protocol ConfigCatLogger) implementation with theloggerconfiguration option. The default logger implementation still usingos_log. - Privacy manifest file that describes the SDK's required reason API usage.
visionOSdevice platform support.
Breaking changes
- The
onConfigChangedhook now gets aConfigobject that contains all the newly downloaded settings & segments. - The
custominit parameter ofConfigCatUsernow acceptsAnytyped values not just strings. This allows the usage of various types in the user object's custom attributes. - Renamed
matchedEvaluationRule/matchedEvaluationPercentageRuleproperties ofEvaluationDetailstomatchedTargetingRule/matchedPercentageOption - Renamed
LogLeveltoConfigCatLogLevel.
v10.0.0
Added
-
The concept of Snapshots. They are for capturing the state of the SDK's feature flag data. A snapshot allows synchronous operations on the captured context.
let snapshot = configCatClient.snapshot() let isMyFeatureEnabled = snapshot.getValue(for: "isMyFeatureEnabled", defaultValue: false)
Snapshots are created from the actual state of the SDK; therefore, it's crucial to know whether the SDK has valid feature flag data to work on. The SDK already provides an
onClientReadyhook to determine whether creating snapshots is safe. It's being changed to accept astateparameter to give details about the SDK's initialization state.client.hooks.addOnReady { state in // the state parameter indicates what is the SDK's initialization state }
These are the possible
statevalues:noFlagData: This means the SDK has no feature flag data to work on (it didn't get anything from the cache or the network)hasLocalOverrideFlagDataOnly: The SDK was initialized withlocalOnlyflag overrides.hasCachedFlagDataOnly: The SDK has feature flag data only from the cache. It can happen when the SDK is configured withPollingModes.manualPoll()and there isn't yet aclient.forceRefresh()call. Another example could be an SDK configured withPollingModes.autoPoll(), but it can't reach the ConfigCat CDN, so it falls back to the cache.hasUpToDateFlagData: The SDK is initialized with up-to-date feature flag data.
This functionality was extended with a new awaitable method
waitForReady(), which asynchronously waits for theonClientReadyhook to fire and returns with the SDK's initialization state.let state = await client.waitForReady()
Changed
- Standardized config cache key generation algorithm and cache payload format to allow shared caches to be used by SDKs of different platforms.
Removed
getVariationId()andgetAllVariationIds(). Alternative:getValueDetails()/getAllValueDetails().refresh(). Alternative:forceRefresh().- Init function of
PollingModes.autoPoll()with anonConfigChangedcallback parameter. Alternative for subscribing to config changes: Hooks. - Each
***Sync()method that usedDispatchSemaphorefor synchronizing mainly asynchronous operations. For an alternative, see the added Snapshots feature.