API/Autodoc/Classes/RuStore.RemoteConfig.RuStoreRemoteConfigClient.en.md


RuStore::RemoteConfig::RuStoreRemoteConfigClient

The class implements an API for obtaining data configuration from a remote server. It encapsulates the configuration request from the server, caching, and background update.

Public Functions

Name
bool Init(RuStoreRemoteConfigClientSettings settings, IRemoteConfigClientEventListener eventListener =null)
Initializes the singleton RuStoreRemoteConfigClient. For operation in UpdateBehaviour.Actual mode, initialization can be performed without creating an extension of the Application class. In this case, the APP_ID parameter must be passed from C#.
bool Init(IRemoteConfigClientEventListener eventListener =null)
Initializes the singleton RuStoreRemoteConfigClient. The initialization of the Java class RuStoreUnityRemoteConfigClient with UpdateBehaviour.Default/UpdateBehaviour.Snapshot parameters should occur at the moment of Application.onCreate(), because when starting background synchronization, the SDK must be initialized.
void GetRemoteConfig(Action< RuStoreError > onFailure, Action< RemoteConfig > onSuccess)
Obtaining data configuration depending on the update policy selected during initialization.
void SetAccount(string account)
Sets the Account parameter, which can be used to obtain a specific configuration.
void SetLanguage(string language)
Sets the Language parameter, which can be used to obtain a specific configuration.

Public Properties

Name
bool IsInitialized — Returns true if the singleton is initialized, otherwise false.
RuStoreRemoteConfigClient Instance — Returns the single instance of RuStoreRemoteConfigClient (implementation of the Singleton pattern). If the instance has not been created yet, it creates one.

Public Attributes

Name
string PluginVersion — Plugin version.

function Init

bool Init(
    RuStoreRemoteConfigClientSettings settings,
    IRemoteConfigClientEventListener eventListener =null
)

Initializes the singleton RuStoreRemoteConfigClient. For operation in UpdateBehaviour.Actual mode, initialization can be performed without creating an extension of the Application class. In this case, the APP_ID parameter must be passed from C#.

Parameters:

Return: Returns true if initialization was successful, otherwise false.


bool isInitialized = RuStoreRemoteConfigClient.Instance.Init(
    settings: new RuStoreRemoteConfigClientSettings() {
        appId = "app123",
        account = "user123",
        language = "ru"
    },
    eventListener: new MyRemoteConfigEventListener()
);

Filename: public_bool_Init_with_settings.cs

function Init

bool Init(
    IRemoteConfigClientEventListener eventListener =null
)

Initializes the singleton RuStoreRemoteConfigClient. The initialization of the Java class RuStoreUnityRemoteConfigClient with UpdateBehaviour.Default/UpdateBehaviour.Snapshot parameters should occur at the moment of Application.onCreate(), because when starting background synchronization, the SDK must be initialized.

Parameters:

Return: Returns true if initialization was successful, otherwise false.


bool isInitialized = RuStoreRemoteConfigClient.Instance.Init(
    eventListener: null
);

Filename: public_bool_Init.cs

function GetRemoteConfig

void GetRemoteConfig(
    Action< RuStoreError > onFailure,
    Action< RemoteConfig > onSuccess
)

Obtaining data configuration depending on the update policy selected during initialization.

Parameters:

  • onFailure Action performed in case of an error. Returns an RuStore.RuStoreError object with error information.
  • onSuccess Action performed on successful completion of the operation. Returns a RuStore.RemoteConfig.RemoteConfig object with information about the current data set.

RuStoreRemoteConfigClient.Instance.GetRemoteConfig(
    onFailure: (error) => {
        // Process error
    },
    onSuccess: (config) => {
        // Process config
    }
);

Filename: public_void_GetRemoteConfig.cs

function SetAccount

void SetAccount(
    string account
)

Sets the Account parameter, which can be used to obtain a specific configuration.

Parameters:

  • account Value of the Account parameter.

RuStoreRemoteConfigClient.Instance.SetAccount(account: "user123");

Filename: public_void_SetAccount.cs

function SetLanguage

void SetLanguage(
    string language
)

Sets the Language parameter, which can be used to obtain a specific configuration.

Parameters:

  • language Value of the Language parameter.

RuStoreRemoteConfigClient.Instance.SetLanguage("en");

Filename: public_void_SetLanguage.cs

property IsInitialized

bool IsInitialized;

Returns true if the singleton is initialized, otherwise false.

property Instance

static RuStoreRemoteConfigClient Instance;

Returns the single instance of RuStoreRemoteConfigClient (implementation of the Singleton pattern). If the instance has not been created yet, it creates one.


var client = RuStoreRemoteConfigClient.Instance;

Filename: public_static_RuStoreRemoteConfigClient_Instance.cs

variable PluginVersion

static string PluginVersion = "10.3.1";

Plugin version.