Entry point for FirebaseRemoteConfig. Callers should first get the singleton object using
getInstance(), and then call the operations on that singleton object. The
singleton object contains the complete set of Remote Config parameter values available to
your app, including the Active Config and Default Config. This object also caches values
fetched from the Remote Config Server until they are copied to the Active Config by calling
activateFetched().
| boolean | DEFAULT_VALUE_FOR_BOOLEAN | |
| double | DEFAULT_VALUE_FOR_DOUBLE | |
| long | DEFAULT_VALUE_FOR_LONG | |
| String | DEFAULT_VALUE_FOR_STRING | |
| int | LAST_FETCH_STATUS_FAILURE | Indicates that the most recent attempt to fetch parameter values from the Remote Config Server has failed. |
| int | LAST_FETCH_STATUS_NO_FETCH_YET | Indicates that the FirebaseRemoteConfig singleton object has not yet attempted to fetch parameter values from the Remote Config Server. |
| int | LAST_FETCH_STATUS_SUCCESS | Indicates that the most recent fetch of parameter values from the Remote Config Server was completed successfully. |
| int | LAST_FETCH_STATUS_THROTTLED | Indicates that the most recent attempt to fetch parameter values from the Remote Config Server was throttled. |
| int | VALUE_SOURCE_DEFAULT | Indicates that the value returned was retrieved from the Default Config. |
| int | VALUE_SOURCE_REMOTE | Indicates that the value returned was retrieved from the Remote Config Server. |
| int | VALUE_SOURCE_STATIC | Indicates that the value returned is the static default value. |
| public static final byte[] | DEFAULT_VALUE_FOR_BYTE_ARRAY |
| boolean |
activateFetched()
Activates the Fetched Config, so that the fetched key-values take effect.
|
| Task<Void> |
fetch(long cacheExpirationSeconds)
Fetches parameter values for your app.
|
| Task<Void> |
fetch()
Fetches parameter values for your app.
|
| boolean |
getBoolean(String key,
String
namespace)
Gets the value corresponding to the specified key, as a boolean, in the
specified namespace.
|
| boolean | |
| byte[] |
getByteArray(String key,
String
namespace)
Gets the value corresponding to the specified key, in the specified namespace,
as a byte array.
|
| byte[] | |
| double | |
| double | |
| FirebaseRemoteConfigInfo |
getInfo()
Gets the current state of the FirebaseRemoteConfig singleton object.
|
| static FirebaseRemoteConfig |
getInstance()
Getter for the singleton FirebaseRemoteConfig object.
|
| Set<String> |
getKeysByPrefix(String prefix,
String
namespace)
Gets the set of keys that start with the given prefix, in the given namespace.
|
| Set<String> | |
| long | |
| long | |
| String | |
| String | |
| FirebaseRemoteConfigValue | |
| FirebaseRemoteConfigValue |
getValue(String key,
String
namespace)
Gets the
FirebaseRemoteConfigValue corresponding to the specified key.
|
| void |
setConfigSettings(FirebaseRemoteConfigSettings
settings)
Changes the settings for the FirebaseRemoteConfig object's operations, such as
turning the developer mode on.
|
| void |
setDefaults(int resourceId)
Sets defaults in the default namespace, using an XML resource.
|
| void | |
| void |
setDefaults(int resourceId, String namespace)
Set defaults in the given namespace, using an XML resource file.
|
| void |
Indicates that the most recent attempt to fetch parameter values from the Remote Config Server has failed.
Indicates that the FirebaseRemoteConfig singleton object has not yet attempted to fetch parameter values from the Remote Config Server.
Indicates that the most recent fetch of parameter values from the Remote Config Server was completed successfully.
Indicates that the most recent attempt to fetch parameter values from the Remote Config Server was throttled.
Indicates that the value returned was retrieved from the Default Config.
Indicates that the value returned was retrieved from the Remote Config Server.
Indicates that the value returned is the static default value.
Activates the Fetched Config, so that the fetched key-values take effect.
true if there was a Fetched Config, and it was activated.
false if no Fetched Config was found, or the Fetched Config was already
activated.Fetches parameter values for your app. Configuration values may be served from the Default Config (local cache) or from the Remote Config Server, depending on how much time has elapsed since parameter values were last fetched from the Remote Config server. This method lets the caller specify the cache expiration in seconds.
To identify the current app instance, the fetch request creates a Firebase Instance
ID token, which periodically sends data to the Firebase backend. To stop the periodic
sync, call
deleteInstanceId(); calling fetchConfig again creates a new
token and resumes the periodic sync.
| cacheExpirationSeconds | If the data in the cache was fetched no longer than this many seconds ago, this method will return the cached data. If not, a fetch from the Remote Config Server will be attempted. |
|---|
Task object to
track the fetch result.Fetches parameter values for your app. Parameter values may be from the Default Config (local cache), or from the Remote Config Server, depending on how much time has elapsed since parameter values were last fetched from the Remote Config server. This method uses the default cache expiration of 12 hours.
To identify the current app instance, the fetch request creates a Firebase Instance
ID token, which periodically sends data to the Firebase backend. To stop the periodic
sync, call
deleteInstanceId(); calling fetchConfig again creates a new
token and resumes the periodic sync.
Task object to
track the fetch result.Gets the value corresponding to the specified key, as a boolean, in the specified namespace.
| key | The Remote Config parameter key to look up. |
|---|---|
| namespace | The namespace in which to look up the key. |
"1", "true", "t", "yes", "y", and "on" are strings that are interpreted (case
insensitive) as true, and "0", "false", "f", "no", "n", "off", and
empty string are interpreted (case insensitive) as false.
Gets the value corresponding to the specified key, as a boolean.
This method uses the default namespace. To query in another namespace, use the
getBoolean(String, String) method.
| key | The Remote Config parameter key to look up. |
|---|
"1", "true", "t", "yes", "y", and "on" are strings that are interpreted (case
insensitive) as true, and "0", "false", "f", "no", "n", "off", and
empty string are interpreted (case insensitive) as false.
Gets the value corresponding to the specified key, in the specified namespace, as a byte array.
| key | The Remote Config parameter key to look up. |
|---|---|
| namespace | The namespace in which to look up the key. |
Gets the value corresponding to the specified key, as a byte array.
This method uses the default namespace. To query in another namespace, use the
getByteArray(String, String) method.
| key | The Remote Config parameter key to look up. |
|---|
Gets the value corresponding to the specified key, in the specified namespace, as a double.
| key | The Remote Config parameter key to look up. |
|---|---|
| namespace | The namespace in which to look up the key. |
Gets the value corresponding to the specified key, as a double.
This method uses the default namespace. To query in another namespace, use
getDouble(String, String).
| key | The Remote Config parameter key to look up. |
|---|
Gets the current state of the FirebaseRemoteConfig singleton object.
FirebaseRemoteConfigInfo
wrapping the current state.Getter for the singleton FirebaseRemoteConfig object. Clients start by getting this object, and then call all of the FirebaseRemoteConfig API methods on this object.
Note: If you test your app using StrictMode, note that the initial getInstance() call on app creation reads from a local file. To avoid StrictMode disk read errors, this initial call should not be made on the UI thread. All subsequent getInstance() calls are safe on the UI thread, because they only read from memory. You should never leave StrictMode enabled in applications distributed on Google Play.
FirebaseRemoteConfig uses the default FirebaseApp, so if no FirebaseApp has been
initialized yet, this method will throw an IllegalStateException.
To identify the current app instance, the fetch request creates a Firebase Instance
ID token, which periodically sends data to the Firebase backend. To stop the periodic
sync, call
deleteInstanceId(); calling fetchConfig again creates a new
token and resumes the periodic sync.
Gets the set of keys that start with the given prefix, in the given namespace.
| prefix | The key prefix to look for. If empty or null, this method will return all keys in the given namespace. |
|---|---|
| namespace | The namespace in which to look up the keys. |
Gets the set of keys that start with the given prefix.
This method uses the default namespace. To query in another namespace, use
getKeysByPrefix(String, String).
| prefix | The key prefix to look for. If empty or null, this method will return all keys. |
|---|
Gets the value corresponding to the specified key, as a long.
This method uses the default namespace. To query in another namespace, use
getLong(String, String).
| key | The Remote Config parameter key to look up. |
|---|
Gets the value corresponding to the specified key, in the specified namespace, as a long.
| key | The Remote Config parameter config key to look up. |
|---|---|
| namespace | The namespace in which to look up the key. |
Gets the value corresponding to the specified key, as a String.
This method uses the default namespace. To query in another namespace, use the
getString(String, String) method.
| key | The Remote Config parameter key to look up. |
|---|
Gets value as a string corresponding to the specified key in the specified namespace.
| key | The Remote Config parameter key to look up. |
|---|---|
| namespace | The namespace in which to look up the key. |
Gets the FirebaseRemoteConfigValue
corresponding to the specified key.
This method uses the default namespace. To query in another namespace, use
getValue(String, String).
| key | The Remote Config parameter key to look up. |
|---|
FirebaseRemoteConfigValue
object.Gets the FirebaseRemoteConfigValue
corresponding to the specified key.
| key | The Remote Config parameter key to look up. |
|---|---|
| namespace | The namespace in which to look up the key. |
FirebaseRemoteConfigValue
object.Changes the settings for the FirebaseRemoteConfig object's operations, such as turning the developer mode on.
| settings | The new settings to be applied. If null is passed, it will clear
all current settings. |
|---|
Sets defaults in the default namespace, using an XML resource.
| resourceId | Id for the XML resource, which should be in your application's res/xml folder. |
|---|
Sets defaults in the default namespace.
| defaults | Key value map to be used for setting the defaults. The values in this map
should be one of the types Long, String,
Double, byte[], or Boolean. |
|---|---|
| namespace | The namespace in which to set the defaults. |
Set defaults in the given namespace, using an XML resource file.
| resourceId | Id for the XML resource, which should be in your application's res/xml folder. |
|---|---|
| namespace | The namespace in which to set the defaults. |
Sets defaults in the default namespace. To set defaults in a different namespace,
use
setDefaults(java.util.Map, String).
| defaults | Key value map to be used for setting the defaults. The values in this map
should be one of the types Long, String,
Double, byte[], or Boolean. |
|---|