ConfigResolver

class ConfigResolver(keys: List<ConfigKey>, overrides: ConfigOverrideSource? = null, remote: (ConfigKey) -> ConfigValue?)

Implements the documented RemoteConfigClient resolution order — local override, then fetched remote value, then the key's compiled-in default — so every provider bridge resolves identically.

Values from either layer that don't match the key (ConfigKey.accepts) are ignored and resolution falls through to the next layer, so a stale override or a remote value of the wrong type can never surface as the wrong type to callers.

class FirebaseRemoteConfigClient(private val firebase: FirebaseRemoteConfig, overrides: LocalOverrideStore) :
RemoteConfigClient {
private val resolver = ConfigResolver(AppConfigKeys.ALL_KEYS, overrides) { key -> firebase.readTyped(key) }
override fun value(key: ConfigKey) = resolver.resolve(key).value
override fun allValues() = resolver.resolveAll()
override suspend fun fetchAndActivate() { firebase.fetchAndActivate().await() }
}

Parameters

keys

the app's key registry, used by resolveAll.

overrides

optional override layer; pass null in release builds.

remote

reads the provider's cached value for a key, or null when it has none.

Constructors

Link copied to clipboard
constructor(keys: List<ConfigKey>, overrides: ConfigOverrideSource? = null, remote: (ConfigKey) -> ConfigValue?)

Functions

Link copied to clipboard
Link copied to clipboard