Remote Config SDK API reference
Classes
RemoteConfigService
public sealed class RemoteConfigService
Use this class to fetch and apply your configuration settings at runtime. RemoteConfigService
is wrapper class to mimic the functionality of underlying ConfigManagerImpl
class. It uses an instance of ConfigManagerImpl
class, making it a primitive class of ConfigManagerImpl
.
FetchCompleted
public event Action<ConfigResponse> FetchCompleted
This event fires the the configuration manager successfully fetches settings from the service. It returns a struct representing the response of a Remote Config fetch.
appConfig
public RuntimeConfig appConfig
Retrieves the RuntimeConfig
object for handling Remote Config settings. Use this property to access the following methods and classes:
Method | Description |
---|---|
public string assignmentID | A unique string identifier used for reporting and analytic purposes. The Remote Config service generates 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. |
public string[] GetJson () | Returns string representation of the JSON value of a corresponding key from the remote service, if one exists. |
GetConfig
public RuntimeConfig GetConfig(string configType)
Retrieves the particular config from multiple config objects by passing the configType.
SetCustomUserID
public void SetCustomUserID(string customUserID)
Sets a custom user identifier for the Remote Config delivery request payload.
SetEnvironmentID
public void SetEnvironmentID(string environmentID)
Sets an environment identifier for the Remote Config delivery request payload.
SetPlayerIdentityTokenID
public void SetPlayerIdentityTokenID(string playerIdentityTokenID)
Sets a player identity token.
SetUserID
public void SetUserID(string iid)
Sets the userId
to InstallationID
identifier coming from Core services.
SetPlayerID
public void SetPlayerID(string playerID)
Sets the player identifier coming from Authentication services.
SetAnalyticsUserID
public void SetAnalyticsUserID(string analyticsUserID)
Sets the analytics user identifier coming from Core services.
SetConfigAssignmentHash
public void SetConfigAssignmentHash(string confiAssignmentHashID)
Sets the configAssignmentHash
identifier coming from Core services.
FetchConfigsAsync
public Task<RuntimeConfig> FetchConfigsAsync<T, T2, T3>(string configType, T userAttributes, T2 appAttributes, T3 filterAttributes)
Fetches an app configuration settings from the remote server.
Parameter | Description |
---|---|
configType | A string containing a cofigType . If none apply, use an empty string. |
userAttributes | A struct containing custom user attributes. If none apply, use an empty struct. |
appAttributes | A struct containing custom app attributes. If none apply, use an empty struct. |
filterAttributes | A struct containing custom filter attributes. If none apply, use an empty struct. |
T | The type of the userAttributes struct. |
T2 | The type of the appAttributes struct. |
T3 | The type of the filterAttributes struct. |
Enums
ConfigOrigin
An enum describing the origin point of your most recently loaded configuration settings.
Value | Description |
---|---|
Default | Indicates that no configuration settings loaded in the current session. |
Cached | Indicates that the configuration settings loaded in the current session are cached from a previous session (in other words, no new configuration settings loaded). |
Remote | Indicates that new configuration settings loaded from the remote server in the current session. |
ConfigRequestStatus
An enum representing the status of the current Remote Config request.
Value | Description |
---|---|
None | Indicates that no Remote Config request has been made. |
Failed | Indicates that the Remote Config request failed. |
Success | Indicates that the Remote Config request succeeded. |
Pending | Indicates that the Remote Config request is still processing. |