ConfigCat SDK for Kotlin Multiplatform. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
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 returns with a result object to indicate whether the refresh succeeded or not.
Changed
pollingIntervalSeconds: Int -> pollingInterval: Duration.
maxInitWaitTimeSeconds: Int -> maxInitWaitTime: Duration.
cacheRefreshIntervalSeconds: Int -> cacheRefreshInterval: Duration.
requestTimeoutMs: Long -> requestTimeout: Duration.
The static close() method was split to an instance level close() method which closes the given ConfigCatClient and to a static closeAll() method which closes all instantiated client instances.
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.
Related issues (only if applicable)
1
Requirement checklist (only if applicable)
[x] I have covered the applied changes with automated tests.
[x] I have executed the full automated test set against my changes.
[x] I have validated my changes against all supported platform versions.
Describe the purpose of your pull request
This PR contains the following:
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 returns with a result object to indicate whether the refresh succeeded or not.Changed
pollingIntervalSeconds: Int
->pollingInterval: Duration
.maxInitWaitTimeSeconds: Int
->maxInitWaitTime: Duration
.cacheRefreshIntervalSeconds: Int
->cacheRefreshInterval: Duration
.requestTimeoutMs: Long
->requestTimeout: Duration
.close()
method was split to an instance levelclose()
method which closes the givenConfigCatClient
and to a staticcloseAll()
method which closes all instantiated client instances.lazyLoad
and interval ofautoPoll
is compared against a cachedfetchTime
, which allows the SDK not necessarily download a newconfig.json
at each application restart.Related issues (only if applicable)
1
Requirement checklist (only if applicable)