firebase:: remote_config
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.
Enumerations |
|
---|---|
ConfigSetting{
|
enum Keys of API settings. |
FetchFailureReason{
|
enum Describes the most recent fetch failure. |
LastFetchStatus{
|
enum Describes the most recent fetch request status. |
ValueSource{
|
enum Describes the source a config value was retrieved from. |
Functions |
|
---|---|
ActivateFetched()
|
bool
Applies the most recently fetched data, so that its values can be accessed.
|
Fetch()
|
Future< void >
Fetches config data from the server.
|
Fetch(uint64_t cache_expiration_in_seconds)
|
Future< void >
Fetches config data from the server.
|
FetchLastResult()
|
Future< void >
Get the (possibly still pending) results of the most recent Fetch() call.
|
GetBoolean(const char *key)
|
bool
Returns the value associated with a key, converted to a bool.
|
GetBoolean(const char *key, const char *config_namespace)
|
bool
Returns the value associated with a key, converted to a bool.
|
GetBoolean(const char *key, ValueInfo *info)
|
bool
Returns the value associated with a key, converted to a bool.
|
GetBoolean(const char *key, const char *config_namespace, ValueInfo *info)
|
bool
Returns the value associated with a key, converted to a bool.
|
GetConfigSetting(ConfigSetting setting)
|
std::string
Retrieve an internal configuration setting.
|
GetData(const char *key)
|
std::vector< unsigned char >
Returns the value associated with a key, as a vector of raw byte-data.
|
GetData(const char *key, const char *config_namespace)
|
std::vector< unsigned char >
Returns the value associated with a key, as a vector of raw byte-data.
|
GetData(const char *key, ValueInfo *info)
|
std::vector< unsigned char >
Returns the value associated with a key, as a vector of raw byte-data.
|
GetData(const char *key, const char *config_namespace, ValueInfo *info)
|
std::vector< unsigned char >
Returns the value associated with a key, as a vector of raw byte-data.
|
GetDouble(const char *key)
|
double
Returns the value associated with a key, converted to a double.
|
GetDouble(const char *key, const char *config_namespace)
|
double
Returns the value associated with a key, converted to a double.
|
GetDouble(const char *key, ValueInfo *info)
|
double
Returns the value associated with a key, converted to a double.
|
GetDouble(const char *key, const char *config_namespace, ValueInfo *info)
|
double
Returns the value associated with a key, converted to a double.
|
GetInfo()
|
const ConfigInfo &
Returns information about the last fetch request, in the form of a ConfigInfo struct.
|
GetKeys()
|
std::vector< std::string >
Gets the set of all keys in the default namespace.
|
GetKeys(const char *config_namespace)
|
std::vector< std::string >
Gets the set of all keys in the given namespace.
|
GetKeysByPrefix(const char *prefix)
|
std::vector< std::string >
Gets the set of keys that start with the given prefix, in the default namespace.
|
GetKeysByPrefix(const char *prefix, const char *config_namespace)
|
std::vector< std::string >
Gets the set of keys that start with the given prefix, in the given namespace.
|
GetLong(const char *key)
|
int64_t
Returns the value associated with a key, converted to a 64-bit integer.
|
GetLong(const char *key, const char *config_namespace)
|
int64_t
Returns the value associated with a key, converted to a 64-bit integer.
|
GetLong(const char *key, ValueInfo *info)
|
int64_t
Returns the value associated with a key, converted to a 64-bit integer.
|
GetLong(const char *key, const char *config_namespace, ValueInfo *info)
|
int64_t
Returns the value associated with a key, converted to a 64-bit integer.
|
GetString(const char *key)
|
std::string
Returns the value associated with a key, converted to a string.
|
GetString(const char *key, const char *config_namespace)
|
std::string
Returns the value associated with a key, converted to a string.
|
GetString(const char *key, ValueInfo *info)
|
std::string
Returns the value associated with a key, converted to a string.
|
GetString(const char *key, const char *config_namespace, ValueInfo *info)
|
std::string
Returns the value associated with a key, converted to a string.
|
Initialize(const App & app)
|
Initialize the RemoteConfig API.
|
SetConfigSetting(ConfigSetting setting, const char *value)
|
void
Sets an internal configuration setting.
|
SetDefaults(int defaults_resource_id)
|
void
Sets the default values, using an XML resource.
|
SetDefaults(int defaults_resource_id, const char *defaults_namespace)
|
void
Sets the default values, using an XML resource.
|
SetDefaults(const ConfigKeyValueVariant *defaults, size_t number_of_defaults)
|
void
Sets the default values based on a mapping of string to Variant.
|
SetDefaults(const ConfigKeyValueVariant *defaults, size_t number_of_defaults, const char *config_namespace)
|
void
Sets the default values based on a mapping of string to Variant.
|
SetDefaults(const ConfigKeyValue *defaults, size_t number_of_defaults)
|
void
Sets the default values based on a string map.
|
SetDefaults(const ConfigKeyValue *defaults, size_t number_of_defaults, const char *config_namespace)
|
void
Sets the default values based on a string map.
|
Terminate()
|
void
Terminate the RemoteConfig API.
|
Structs |
|
---|---|
firebase:: |
Describes the state of the most recent Fetch() call. |
firebase:: |
Describes a mapping of a key to a string value. |
firebase:: |
Describes a mapping of a key to a value of any type. |
firebase:: |
Describes a retrieved value. |
Enumerations
ConfigSetting
ConfigSetting
Keys of API settings.
See also: SetConfigSetting See also: GetConfigSetting
Properties | |
---|---|
kConfigSettingDeveloperMode
|
Set the value associated with this key to "1" to enable developer mode (i.e disable throttling) and "0" to disable. |
FetchFailureReason
FetchFailureReason
Describes the most recent fetch failure.
LastFetchStatus
LastFetchStatus
Describes the most recent fetch request status.
ValueSource
ValueSource
Describes the source a config value was retrieved from.
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.
Details | |
---|---|
Returns |
true if a previously fetch configuration was activated, false if a fetched configuration wasn't found or the configuration was previously activated.
|
Fetch
Future< void > Fetch()
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 | |
---|---|
Returns |
A Future which can be used to determine when the fetch is complete.
|
Fetch
Future< void > Fetch( uint64_t cache_expiration_in_seconds )
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 |
|
||
Returns |
A Future which can be used to determine when the fetch is complete.
|
FetchLastResult
Future< void > FetchLastResult()
GetBoolean
bool GetBoolean( const char *key )
Returns the value associated with a key, converted to a bool.
Values of "1", "true", "t", "yes", "y" and "on" are interpreted (case insensitive) as true
and "0", "false", "f", "no", "n", "off", and empty strings are interpreted (case insensitive) as false
.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Value associated with the specified key converted to a boolean value.
|
GetBoolean
bool GetBoolean( const char *key, const char *config_namespace )
Returns the value associated with a key, converted to a bool.
Values of "1", "true", "t", "yes", "y" and "on" are interpreted (case insensitive) as true
and "0", "false", "f", "no", "n", "off", and empty strings are interpreted (case insensitive) as false
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Value associated with the specified key converted to a boolean value.
|
GetBoolean
bool GetBoolean( const char *key, ValueInfo *info )
Returns the value associated with a key, converted to a bool.
Values of "1", "true", "t", "yes", "y" and "on" are interpreted (case insensitive) as true
and "0", "false", "f", "no", "n", "off", and empty strings are interpreted (case insensitive) as false
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Value associated with the specified key converted to a boolean value.
|
GetBoolean
bool GetBoolean( const char *key, const char *config_namespace, ValueInfo *info )
Returns the value associated with a key, converted to a bool.
Values of "1", "true", "t", "yes", "y" and "on" are interpreted (case insensitive) as true
and "0", "false", "f", "no", "n", "off", and empty strings are interpreted (case insensitive) as false
.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
Value associated with the specified key converted to a boolean value.
|
GetConfigSetting
std::string GetConfigSetting( ConfigSetting setting )
Retrieve an internal configuration setting.
See also: SetConfigSetting
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The value of the config
|
GetData
std::vector< unsigned char > GetData( const char *key )
Returns the value associated with a key, as a vector of raw byte-data.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Vector of bytes.
|
GetData
std::vector< unsigned char > GetData( const char *key, const char *config_namespace )
Returns the value associated with a key, as a vector of raw byte-data.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Vector of bytes.
|
GetData
std::vector< unsigned char > GetData( const char *key, ValueInfo *info )
Returns the value associated with a key, as a vector of raw byte-data.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Vector of bytes.
|
GetData
std::vector< unsigned char > GetData( const char *key, const char *config_namespace, ValueInfo *info )
Returns the value associated with a key, as a vector of raw byte-data.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
Vector of bytes.
|
GetDouble
double GetDouble( const char *key )
Returns the value associated with a key, converted to a double.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Value associated with the specified key converted to a double.
|
GetDouble
double GetDouble( const char *key, const char *config_namespace )
Returns the value associated with a key, converted to a double.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Value associated with the specified key converted to a double.
|
GetDouble
double GetDouble( const char *key, ValueInfo *info )
Returns the value associated with a key, converted to a double.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Value associated with the specified key converted to a double.
|
GetDouble
double GetDouble( const char *key, const char *config_namespace, ValueInfo *info )
Returns the value associated with a key, converted to a double.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
Value associated with the specified key converted to a double.
|
GetInfo
const ConfigInfo & GetInfo()
Returns information about the last fetch request, in the form of a ConfigInfo struct.
Details | |
---|---|
Returns |
A ConfigInfo struct, containing fields reflecting the state of the most recent fetch request.
|
GetKeys
std::vector< std::string > GetKeys()
Gets the set of all keys in the default namespace.
Details | |
---|---|
Returns |
Set of all Remote Config parameter keys in the default namespace.
|
GetKeys
std::vector< std::string > GetKeys( const char *config_namespace )
Gets the set of all keys in the given namespace.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Set of all Remote Config parameter keys in the given namespace.
|
GetKeysByPrefix
std::vector< std::string > GetKeysByPrefix( const char *prefix )
Gets the set of keys that start with the given prefix, in the default namespace.
Details | |||
---|---|---|---|
Parameters |
|
||
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.
|
GetKeysByPrefix
std::vector< std::string > GetKeysByPrefix( const char *prefix, const char *config_namespace )
Gets the set of keys that start with the given prefix, in the given namespace.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
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.
|
GetLong
int64_t GetLong( const char *key )
Returns the value associated with a key, converted to a 64-bit integer.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Value associated with the specified key converted to a 64-bit integer.
|
GetLong
int64_t GetLong( const char *key, const char *config_namespace )
Returns the value associated with a key, converted to a 64-bit integer.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Value associated with the specified key converted to a 64-bit integer.
|
GetLong
int64_t GetLong( const char *key, ValueInfo *info )
Returns the value associated with a key, converted to a 64-bit integer.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Value associated with the specified key converted to a 64-bit integer.
|
GetLong
int64_t GetLong( const char *key, const char *config_namespace, ValueInfo *info )
Returns the value associated with a key, converted to a 64-bit integer.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
Value associated with the specified key converted to a 64-bit integer.
|
GetString
std::string GetString( const char *key )
Returns the value associated with a key, converted to a string.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Value as a string associated with the specified key.
|
GetString
std::string GetString( const char *key, const char *config_namespace )
Returns the value associated with a key, converted to a string.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Value as a string associated with the specified key.
|
GetString
std::string GetString( const char *key, ValueInfo *info )
Returns the value associated with a key, converted to a string.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Value as a string associated with the specified key.
|
GetString
std::string GetString( const char *key, const char *config_namespace, ValueInfo *info )
Returns the value associated with a key, converted to a string.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
Initialize
InitResult Initialize( const App & app )
Initialize the RemoteConfig API.
This must be called prior to calling any other methods in the firebase::remote_config namespace.
See also:firebase::App::GetInstance().
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
kInitResultSuccess if initialization succeeded, or kInitResultFailedMissingDependency on Android if Google Play services is not available on the current device.
|
SetConfigSetting
void SetConfigSetting( ConfigSetting setting, const char *value )
Sets an internal configuration setting.
See also: ConfigSetting
Details | |||||
---|---|---|---|---|---|
Parameters |
|
SetDefaults
void SetDefaults( int defaults_resource_id )
Sets the default values, using an XML resource.
Note:This method is specific to the Android implementation. This completely overwrites all previous default values.
Details | |||
---|---|---|---|
Parameters |
|
SetDefaults
void SetDefaults( int defaults_resource_id, const char *defaults_namespace )
Sets the default values, using an XML resource.
Note:This method is specific to the Android implementation. This completely overwrites all previous default values.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
SetDefaults
void SetDefaults( const ConfigKeyValueVariant *defaults, size_t number_of_defaults )
Sets the default values based on a mapping of string to Variant.
This allows you to specify defaults of type other than string.
The type of each Variant in the map determines the type of data for which you are providing a default. For example, boolean values can be retrieved with GetBool(), integer values can be retrieved with GetLong(), double values can be retrieved with GetDouble(), string values can be retrieved with GetString(), and binary data can be retrieved with GetData(). Aggregate Variant types are not allowed.
See also:firebase::Variant for more information on how to create a Variant of each type.Note:This completely overrides all previous values.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
SetDefaults
void SetDefaults( const ConfigKeyValueVariant *defaults, size_t number_of_defaults, const char *config_namespace )
Sets the default values based on a mapping of string to Variant.
This allows you to specify defaults of type other than string.
The type of each Variant in the map determines the type of data for which you are providing a default. For example, boolean values can be retrieved with GetBool(), integer values can be retrieved with GetLong(), double values can be retrieved with GetDouble(), string values can be retrieved with GetString(), and binary data can be retrieved with GetData(). Aggregate Variant types are not allowed.
See also:firebase::Variant for more information on how to create a Variant of each type.Note:This completely overrides all previous values.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
SetDefaults
void SetDefaults( const ConfigKeyValue *defaults, size_t number_of_defaults )
Sets the default values based on a string map.
Note:This completely overrides all previous values.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
SetDefaults
void SetDefaults( const ConfigKeyValue *defaults, size_t number_of_defaults, const char *config_namespace )
Sets the default values based on a string map.
Note:This completely overrides all previous values in the specified namespace.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
Terminate
void Terminate()
Terminate the RemoteConfig API.
Call this method to free resources associated with the Remote Config API.