Class ConfigManager
Use this class to fetch and apply your configuration settings at runtime.
Inheritance
Namespace: Unity.RemoteConfig
Syntax
public static class ConfigManager
Properties
appConfig
Retrieves the RuntimeConfig
object for handling Remote Config settings.
Declaration
public static RuntimeConfig appConfig { get; }
Property Value
Type | Description |
---|---|
RuntimeConfig | A class representing a single runtime settings configuration. |
Remarks
Use this property to access the following RuntimeConfig
methods and classes:
public string assignmentID
is a unique string identifier used for reporting and analytic purposes. The Remote Config service generate this ID upon configuration requests.
public bool GetBool (string key, bool defaultValue)
retrieves the boolean value of a corresponding key from the remote service, if one exists.
public float GetFloat (string key, float defaultValue)
retrieves the float value of a corresponding key from the remote service, if one exists.
public long GetLong (string key, long defaultValue)
retrieves the long value of a corresponding key from the remote service, if one exists.
public int GetInt (string key, int defaultValue)
retrieves the integer value of a corresponding key from the remote service, if one exists.
public string GetString (string key, string defaultValue)
retrieves the string value of a corresponding key from the remote service, if one exists.
public bool HasKey (string key)
checks if a corresponding key exists in your remote settings.
public string[] GetKeys ()
returns all keys in your remote settings, as an array.
requestStatus
Returns the status of the current configuration request from the service.
Declaration
public static ConfigRequestStatus requestStatus { get; }
Property Value
Type | Description |
---|---|
ConfigRequestStatus | An enum representing the status of the current Remote Config request. |
Methods
FetchConfigs<T, T2>(T, T2)
Fetchs app configuration settings from the remote server.
Declaration
public static void FetchConfigs<T, T2>(T userAttributes, T2 appAttributes)
where T : struct where T2 : struct
Parameters
Type | Name | Description |
---|---|---|
T | userAttributes | A struct containing custom user attributes. If none apply, use an empty struct. |
T2 | appAttributes | A struct containing custom app attributes. If none apply, use an empty struct. |
Type Parameters
Name | Description |
---|---|
T | The type of the |
T2 | The type of the |
SetCustomUserID(String)
Sets a custom user identifier for the Remote Config delivery payload.
Declaration
public static void SetCustomUserID(string customUserID)
Parameters
Type | Name | Description |
---|---|---|
System.String | customUserID | Custom user identifier. |
Events
FetchCompleted
This event fires when the configuration manager successfully fetches settings from the service.
Declaration
public static event Action<ConfigResponse> FetchCompleted
Event Type
Type | Description |
---|---|
System.Action<ConfigResponse> | A struct representing the response of a Remote Config fetch. |