cadabra-firebase / com.fo2rist.cadabra.firebase / FirebaseConfigProvider
FirebaseConfigProvider
class FirebaseConfigProvider
ExperimentsConfigProvider that starts experiments automatically by Firebase Remote Config. Supports two ways for providing config.
-
On the root level. In that case all keys in Firebase that match names of registered experiments will be interpreted as experiments to be activated and respective values as experiment Variants to activate. E.g. For experiment
SomeTest
with variantsA
,B
the remote config should have a keySomeTest
with value eitherA
orB
. -
As nested Json. In that case will looks for the specified key name in remote config and parse it as Json with a single object with key:values pairs via com.fo2rist.cadabra.android.configFromJson.
Constructors
<init> | Create Firebase Config Provider. Be default provider automatically fetches the default config and initiates the remote config loading. If the automatic fetching is turned off or the remote config was updated startExperimentFromRemoteConfig triggers re-loading.FirebaseConfigProvider(fetchAutomatically: Boolean = true, useDefaults: Boolean = true, rootElementKey: String ? = null) |
Functions
onAttached | fun onAttached(): Unit |
startExperimentFromRemoteConfig | Apply current active remote config.fun startExperimentFromRemoteConfig(): Unit |