API/Autodoc/Classes/RuStore.RemoteConfig.RuStoreRemoteConfigClient.en.md
RuStore::RemoteConfig::RuStoreRemoteConfigClient
The class implements an API for retrieving data configuration from a remote server. It encapsulates the configuration request from the server, caching, and background updates.
Public Functions
| Name | |
|---|---|
| bool | Init(RuStoreRemoteConfigClientSettings settings, IRemoteConfigClientEventListener eventListener =null) Initializes the RuStoreRemoteConfigClient singleton. For operation in UpdateBehaviour.Actual mode, initialization can be performed without creating an Application class extension. In this case, the APP_ID parameter must be passed from C#. |
| bool | Init(IRemoteConfigClientEventListener eventListener =null) Initializes the RuStoreRemoteConfigClient singleton. Initialization of the Java class RuStoreUnityRemoteConfigClient with UpdateBehaviour.Default/UpdateBehaviour.Snapshot parameters must occur at the time of Application.onCreate(), since the SDK must be initialized when background synchronization starts. |
| void | GetRemoteConfig(Action< RuStoreError > onFailure, Action< RemoteConfig > onSuccess) Retrieves the data configuration depending on the update policy selected during initialization. |
| void | GetShortSegments(Action< RuStoreError > onFailure, Action< string > onSuccess) Retrieves the short segments of the data configuration. |
| void | SetAccount(string account) Sets the Account parameter, which can be used to obtain a specified configuration. |
| void | SetLanguage(string language) Sets the Language parameter, which can be used to obtain a specified configuration. |
Public Properties
| Name | |
|---|---|
| bool | IsInitialized — Returns true if the singleton is initialized; otherwise, false. |
| RuStoreRemoteConfigClient | Instance — Returns the single instance of RuStoreRemoteConfigClient (Singleton pattern implementation). 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 RuStoreRemoteConfigClient singleton. For operation in UpdateBehaviour.Actual mode, initialization can be performed without creating an Application class extension. In this case, the APP_ID parameter must be passed from C#.
Parameters:
- settings An object of the class RuStore.RemoteConfig.RuStoreRemoteConfigClientSettings. Contains initialization parameters for the UpdateBehaviour.Actual mode.
- eventListener An object of a class implementing the RuStore.RemoteConfig.IRemoteConfigClientEventListener interface.
Return: Returns true if initialization succeeded; 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 RuStoreRemoteConfigClient singleton. Initialization of the Java class RuStoreUnityRemoteConfigClient with UpdateBehaviour.Default/UpdateBehaviour.Snapshot parameters must occur at the time of Application.onCreate(), since the SDK must be initialized when background synchronization starts.
Parameters:
- eventListener An object of a class implementing the RuStore.RemoteConfig.IRemoteConfigClientEventListener interface.
Return: Returns true if initialization succeeded; otherwise, false.
bool isInitialized = RuStoreRemoteConfigClient.Instance.Init(
eventListener: null
);
Filename: public_bool_Init.cs
function GetRemoteConfig
void GetRemoteConfig(
Action< RuStoreError > onFailure,
Action< RemoteConfig > onSuccess
)
Retrieves the data configuration depending on the update policy selected during initialization.
Parameters:
- onFailure The action performed in case of an error. Returns a RuStore.RuStoreError object with error information.
- onSuccess The action performed upon 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 GetShortSegments
void GetShortSegments(
Action< RuStoreError > onFailure,
Action< string > onSuccess
)
Retrieves the short segments of the data configuration.
Parameters:
- onFailure The action performed in case of an error. Returns a RuStore.RuStoreError object with error information.
- onSuccess The action performed upon successful completion of the operation. Returns a string with the short configuration segments.
RuStoreRemoteConfigClient.Instance.GetShortSegments(
onFailure: (error) => {
// Process error
},
onSuccess: (shortSegments) => {
// Process short segments
}
);
Filename: public_void_GetShortSegments.cs
function SetAccount
void SetAccount(
string account
)
Sets the Account parameter, which can be used to obtain a specified configuration.
Parameters:
- account The 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 specified configuration.
Parameters:
- language The 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 (Singleton pattern implementation). 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.5.1";
Plugin version.
- Страницы
- RuStore.RemoteConfig.BackgroundConfigUpdateError.en
- RuStore.RemoteConfig.BackgroundConfigUpdateError
- RuStore.RemoteConfig.IRemoteConfig.en
- RuStore.RemoteConfig.IRemoteConfig
- RuStore.RemoteConfig.IRemoteConfigClientEventListener.en
- RuStore.RemoteConfig.IRemoteConfigClientEventListener
- RuStore.RemoteConfig.Internal.GetRemoteConfigListener.en
- RuStore.RemoteConfig.Internal.GetRemoteConfigListener
- RuStore.RemoteConfig.Internal.GetShortSegmentsListener.en
- RuStore.RemoteConfig.Internal.GetShortSegmentsListener
- RuStore.RemoteConfig.Internal.RemoteConfigClientEventListener.en
- RuStore.RemoteConfig.Internal.RemoteConfigClientEventListener
- RuStore.RemoteConfig.Internal.RemoteConfigClientParameters.en
- RuStore.RemoteConfig.Internal.RemoteConfigClientParameters
- RuStore.RemoteConfig.Internal.RemoteConfigImpl.en
- RuStore.RemoteConfig.Internal.RemoteConfigImpl
- RuStore.RemoteConfig.RemoteConfig.en
- RuStore.RemoteConfig.RemoteConfig
- RuStore.RemoteConfig.RuStoreRemoteConfigClient.en
- RuStore.RemoteConfig.RuStoreRemoteConfigClient
- RuStore.RemoteConfig.RuStoreRemoteConfigClientSettings.en
- RuStore.RemoteConfig.RuStoreRemoteConfigClientSettings
- RuStore.RemoteConfig.BackgroundConfigUpdateError.en
- RuStore.RemoteConfig.BackgroundConfigUpdateError
- RuStore.RemoteConfig.IRemoteConfig.en
- RuStore.RemoteConfig.IRemoteConfig
- RuStore.RemoteConfig.IRemoteConfigClientEventListener.en
- RuStore.RemoteConfig.IRemoteConfigClientEventListener
- RuStore.RemoteConfig.Internal.GetRemoteConfigListener.en
- RuStore.RemoteConfig.Internal.GetRemoteConfigListener
- RuStore.RemoteConfig.Internal.GetShortSegmentsListener.en
- RuStore.RemoteConfig.Internal.GetShortSegmentsListener
- RuStore.RemoteConfig.Internal.RemoteConfigClientEventListener.en
- RuStore.RemoteConfig.Internal.RemoteConfigClientEventListener
- RuStore.RemoteConfig.Internal.RemoteConfigClientParameters.en
- RuStore.RemoteConfig.Internal.RemoteConfigClientParameters
- RuStore.RemoteConfig.Internal.RemoteConfigImpl.en
- RuStore.RemoteConfig.Internal.RemoteConfigImpl
- RuStore.RemoteConfig.RemoteConfig.en
- RuStore.RemoteConfig.RemoteConfig
- RuStore.RemoteConfig.RuStoreRemoteConfigClient.en
- RuStore.RemoteConfig.RuStoreRemoteConfigClient
- RuStore.RemoteConfig.RuStoreRemoteConfigClientSettings.en
- RuStore.RemoteConfig.RuStoreRemoteConfigClientSettings