Firebase.RemoteConfig.FirebaseRemoteConfig

Entry point for the Firebase C# SDK for Remote Config.

Summary

Properties

AllValues
IDictionary< string, ConfigValue >
Returns a Dictionary of Firebase Remote Config key value pairs.
App
App object associated with this FirebaseRemoteConfig.
ConfigSettings
Gets the current settings of the RemoteConfig object.
DefaultCacheExpiration
static TimeSpan
The default cache expiration used by FetchAsync(), equal to 12 hours.
DefaultInstance
Returns the FirebaseRemoteConfig initialized with the default FirebaseApp.
DefaultTimeoutInMilliseconds
static ulong
The default timeout used by FetchAsync(), equal to 30 seconds, in milliseconds.
Info
Returns information about the last fetch request, in the form of a ConfigInfo struct.
Keys
IEnumerable< string >
Gets the set of all Remote Config parameter keys.
OnConfigUpdateListener
EventHandler< ConfigUpdateEventArgs >

Public static functions

GetInstance(FirebaseApp app)
Returns a FirebaseRemoteConfig, initialized with a custom Firebase App.

Public functions

ActivateAsync()
System.Threading.Tasks.Task< bool >
Asynchronously activates the most recently fetched configs, so that the fetched key value pairs take effect.
EnsureInitializedAsync()
System.Threading.Tasks.Task< ConfigInfo >
Returns a Task that contains ConfigInfo representing the initialization status of this Firebase Remote Config instance.
FetchAndActivateAsync()
Task< bool >
Asynchronously fetches and then activates the fetched configs.
FetchAsync()
Task
Fetches config data from the server.
FetchAsync(TimeSpan cacheExpiration)
System.Threading.Tasks.Task
Fetches config data from the server.
GetKeysByPrefix(string prefix)
IEnumerable< string >
Gets the set of keys that start with the given prefix.
GetValue(string key)
Gets the ConfigValue corresponding to the key.
SetConfigSettingsAsync(ConfigSettings settings)
Task
Asynchronously changes the settings for this Remote Config instance.
SetDefaultsAsync(IDictionary< string, object > defaults)
Task
Sets the default values based on a string to object dictionary.

Properties

AllValues

IDictionary< string, ConfigValue > AllValues

Returns a Dictionary of Firebase Remote Config key value pairs.

Evaluates the values of the parameters in the following order: The activated value, if the last successful ActivateAsync() contained the key. The default value, if the key was set with SetDefaultsAsync().

App

FirebaseApp App

App object associated with this FirebaseRemoteConfig.

ConfigSettings

ConfigSettings ConfigSettings

Gets the current settings of the RemoteConfig object.

DefaultCacheExpiration

static TimeSpan DefaultCacheExpiration

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

DefaultInstance

static FirebaseRemoteConfig DefaultInstance

Returns the FirebaseRemoteConfig initialized with the default FirebaseApp.

DefaultTimeoutInMilliseconds

static ulong DefaultTimeoutInMilliseconds

The default timeout used by FetchAsync(), equal to 30 seconds, in milliseconds.

Info

ConfigInfo Info

Returns information about the last fetch request, in the form of a ConfigInfo struct.

Keys

IEnumerable< string > Keys

Gets the set of all Remote Config parameter keys.

OnConfigUpdateListener

EventHandler< ConfigUpdateEventArgs > OnConfigUpdateListener

Public static functions

GetInstance

FirebaseRemoteConfig GetInstance(
  FirebaseApp app
)

Returns a FirebaseRemoteConfig, initialized with a custom Firebase App.

app The customer FirebaseApp used for initialization.

Details
Returns

Public functions

ActivateAsync

System.Threading.Tasks.Task< bool > ActivateAsync()

Asynchronously activates the most recently fetched configs, so that the fetched key value pairs take effect.

Details
Returns
A Task that contains true if fetched configs were activated. The Task will contain false if the configs were already activated.

EnsureInitializedAsync

System.Threading.Tasks.Task< ConfigInfo > EnsureInitializedAsync()

Returns a Task that contains ConfigInfo representing the initialization status of this Firebase Remote Config instance.

Use this method to ensure Set/Get call not being blocked.

Details
Returns
A Task contains ConfigInfo.

FetchAndActivateAsync

Task< bool > FetchAndActivateAsync()

Asynchronously fetches and then activates the fetched configs.

If the time elapsed since the last fetch from the Firebase Remote Config backend is more than the default minimum fetch interval, configs are fetched from the backend.

After the fetch is complete, the configs are activated so that the fetched key value pairs take effect.

Details
Returns
A Task that contains true if the call activated the fetched configs. The Task will contain false if the fetch failed, or the configs were already activated.

FetchAsync

Task FetchAsync()

Fetches config data from the server.

Details
Returns
A Task which can be used to determine with the fetch is complete.

FetchAsync

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

Fetches config data from the server.

Details
Parameters
cacheExpiration
The amount of 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 will always cause a fetch.
Returns
A Task which can be used to determine with the fetch is complete.

GetKeysByPrefix

IEnumerable< string > GetKeysByPrefix(
  string prefix
)

Gets the set of keys that start with the given prefix.

Details
Parameters
prefix
The key prefix to look for. If empty or null, this method will return all keys.
Returns
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
)

Gets the ConfigValue corresponding to the key.

Details
Parameters
key
Key of the value to be retrieved.
Returns
The ConfigValue associated with the key.

SetConfigSettingsAsync

Task SetConfigSettingsAsync(
  ConfigSettings settings
)

Asynchronously changes the settings for this Remote Config instance.

Details
Parameters
settings
The new settings to be applied.
Returns
a Task which can be used to determine when the operation is complete.

SetDefaultsAsync

Task SetDefaultsAsync(
  IDictionary< string, object > defaults
)

Sets the default values based on a string to object dictionary.

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.
Returns
A Task which can be used to determine when the operation is complete.