Firebase.RemoteConfig.FirebaseRemoteConfig

Firebase Remote Config API.

Summary

Firebase Remote Config is a cloud service that lets you change the appearance and behavior of your app without requiring users to download an app update.

Properties

DefaultCacheExpiration
static System.TimeSpan
The default cache expiration used by Fetch(), equal to 12 hours.
Info
static ConfigInfo
A ConfigInfo struct, containing fields reflecting the state of the most recent fetch request.
Keys
static global::System.Collections.Generic.IEnumerable< string >
The set of all Remote Config parameter keys in the default namespace.
Settings
Gets and sets the configuration settings for operations.

Public static functions

ActivateFetched()
bool
Applies the most recently fetched data, so that its values can be accessed.
FetchAsync()
Fetches config data from the server.
FetchAsync(System.TimeSpan cacheExpiration)
Fetches config data from the server.
GetKeys(string configNamespace)
global::System.Collections.Generic.IEnumerable< string >
Gets the set of all keys in the given namespace.
GetKeysByPrefix(string prefix)
global::System.Collections.Generic.IEnumerable< string >
Gets the set of keys that start with the given prefix, in the default namespace.
GetKeysByPrefix(string prefix, string configNamespace)
global::System.Collections.Generic.IEnumerable< string >
Gets the set of keys that start with the given prefix, in the given namespace.
GetValue(string key, string configNamespace)
Gets the ConfigValue corresponding to the specified key.
SetDefaults(System.Collections.Generic.IDictionary< string, object > defaults)
void
Sets the default values based on a string dictionary.
SetDefaults(System.Collections.Generic.IDictionary< string, object > defaults, string config_namespace)
void
Sets the default values based on a string dictionary.

Properties

DefaultCacheExpiration

static System.TimeSpan DefaultCacheExpiration

The default cache expiration used by Fetch(), equal to 12 hours.

Info

static ConfigInfo Info

A ConfigInfo struct, containing fields reflecting the state of the most recent fetch request.

Keys

static global::System.Collections.Generic.IEnumerable< string > Keys

The set of all Remote Config parameter keys in the default namespace.

Settings

static ConfigSettings Settings

Gets and sets the configuration settings for operations.

Get returns a copy of the current settings; to change the settings a ConfigSettings with the new settings needs to be set.

Public static functions

ActivateFetched

bool ActivateFetched()

Applies the most recently fetched data, so that its values can be accessed.

Calls to GetLong(), GetDouble(), GetString() and GetData() will not reflect the new data retrieved by Fetch() until ActivateFetched() is called. This gives the developer control over when newly fetched data is visible to their application.

true if a previously fetch configuration was activated, false if a fetched configuration wasn't found or the configuration was previously activated.

FetchAsync

System.Threading.Tasks.Task FetchAsync()

Fetches config data from the server.

This does not actually apply the data or make it accessible, it merely retrieves it and caches it. To accept and access the newly retrieved values, you must call ActivateFetched(). Note that this function is asynchronous, and will normally take an unspecified amount of time before completion.

A Future which can be used to determine when the fetch is complete.

FetchAsync

System.Threading.Tasks.Task FetchAsync(
  System.TimeSpan cacheExpiration
)

Fetches config data from the server.

Note:This does not actually apply the data or make it accessible, it merely retrieves it and caches it. To accept and access the newly retrieved values, you must call ActivateFetched(). Note that this function is asynchronous, and will normally take an unspecified amount of time before completion.

Details
Parameters
cacheExpiration
The time to keep previously fetch data available. If cached data is available that is newer than cacheExpiration, then the function returns immediately and does not fetch any data. A cacheExpiration of zero seconds will always cause a fetch.
Returns
A Task which can be used to determine when the fetch is complete.

GetKeys

global::System.Collections.Generic.IEnumerable< string > GetKeys(
  string configNamespace
)

Gets the set of all keys in the given namespace.

Details
Parameters
configNamespace
The namespace in which to look up the keys. Set of all Remote Config parameter keys in the given namespace.

GetKeysByPrefix

global::System.Collections.Generic.IEnumerable< string > GetKeysByPrefix(
  string prefix
)

Gets the set of keys that start with the given prefix, in the default namespace.

Details
Parameters
prefix
The key prefix to look for. If empty or null, this method will return all keys. Set of Remote Config parameter keys that start with the specified prefix. Will return an empty set if there are no keys with the given prefix.

GetKeysByPrefix

global::System.Collections.Generic.IEnumerable< string > GetKeysByPrefix(
  string prefix,
  string configNamespace
)

Gets the set of keys that start with the given prefix, in the given namespace.

Details
Parameters
prefix
The key prefix to look for. If empty or null, this method will return all keys in the given namespace.
configNamespace
The namespace in which to look up the keys. Set of Remote Config parameter keys that start with the specified prefix. Will return an empty set if there are no keys with the given prefix.

GetValue

ConfigValue GetValue(
  string key,
  string configNamespace
)

Gets the ConfigValue corresponding to the specified key.

Details
Parameters
key
Key of the value to be retrieved.
config_namespace
Namespace to query for the key. If none is provided, the default namespace is used.
Returns
The ConfigValue associated with the specified key and namespace.

SetDefaults

void SetDefaults(
  System.Collections.Generic.IDictionary< string, object > defaults
)

Sets the default values based on a string dictionary.

Note:This completely overrides all previous values in the default namespace.

Details
Parameters
defaults
IDictionary of string keys to values, representing the new set of defaults to apply. If the same key is specified multiple times, the value associated with the last duplicate key is applied.

SetDefaults

void SetDefaults(
  System.Collections.Generic.IDictionary< string, object > defaults,
  string config_namespace
)

Sets the default values based on a string dictionary.

Note:This completely overrides all previous values in the specified namespace.

Details
Parameters
defaults
IDictionary of string keys to values, representing the new set of defaults to apply. If the same key is specified multiple times, the value associated with the last duplicate key is applied.
config_namespace
Namespace these default values will be applied to.

Send feedback about...

Need help? Visit our support page.