Client ClientSDK API Reference
Client sdk api.
API List
| API | Description |
|---|---|
| InitSdk | Init modules for PGOS service. Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread. |
| InitConfig | Init config for PGOS service Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread. |
| GetConfig | Get configuration value of the specified key, except for "secret_key". |
| Tick | Tick for PGOS service which may dispatch PGOS events. Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread. NOte: In the PGOS Unreal Plugin, developers don't need to care about this interface and should not call it. |
| OnAppEnterForeground | Should be called when the application enters the foreground. (for Android&iOS) |
| OnAppEnterBackground | Should be called when the application enters the background. (for Android&iOS). |
| GetSDKVersion | Get current PGOS SDK version. |
| Destroy | Shutdown PGOS service, should be called during process shutdown if possible. Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread. |
API Details
InitSdk
Init modules for PGOS service. Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread.
/// <summary>
/// Init modules for PGOS service.
/// Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread.
/// </summary>
/// <param name="pgos_params">Request parameters for init sdk.</param>
public void InitSdk(InitSdkParams pgos_params);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | InitSdkParams | Request parameters for init sdk. |
Return: void
InitConfig
Init config for PGOS service Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread.
/// <summary>
/// Init config for PGOS service
/// Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread.
/// </summary>
/// <param name="cfgs">A configuration consisting of key/value pairs, such as "title_id", "secret_key", and others.</param>
public void InitConfig(Dictionary<string, string> cfgs);
Parameters:
| Param | Type | Description |
|---|---|---|
| cfgs | Dictionary<string, string> | A configuration consisting of key/value pairs, such as "title_id", "secret_key", and others. |
Return: void
GetConfig
Get configuration value of the specified key, except for "secret_key".
/// <summary>Get configuration value of the specified key, except for "secret_key".</summary>
/// <param name="cfg_key">The specified key, such as "title_id", "log_level", and others.</param>
public string GetConfig(string cfg_key);
Parameters:
| Param | Type | Description |
|---|---|---|
| cfg_key | string | The specified key, such as "title_id", "log_level", and others. |
Return: string
The configuration value of the specified key.
Tick
Tick for PGOS service which may dispatch PGOS events. Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread. NOte: In the PGOS Unreal Plugin, developers don't need to care about this interface and should not call it.
Deprecated.
/// <summary>
/// Tick for PGOS service which may dispatch PGOS events.
/// Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread.
/// NOte: In the PGOS Unreal Plugin, developers don't need to care about this interface and should not call it.
/// </summary>
public void Tick();
Parameters:
(No parameters)
Return: void
OnAppEnterForeground
Should be called when the application enters the foreground. (for Android&iOS)
/// <summary>Should be called when the application enters the foreground. (for Android&iOS)</summary>
public void OnAppEnterForeground();
Parameters:
(No parameters)
Return: void
OnAppEnterBackground
Should be called when the application enters the background. (for Android&iOS).
/// <summary>Should be called when the application enters the background. (for Android&iOS).</summary>
public void OnAppEnterBackground();
Parameters:
(No parameters)
Return: void
GetSDKVersion
Get current PGOS SDK version.
/// <summary>Get current PGOS SDK version.</summary>
public string GetSDKVersion();
Parameters:
(No parameters)
Return: string
PGOS SDK version string.
Destroy
Shutdown PGOS service, should be called during process shutdown if possible. Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread.
/// <summary>
/// Shutdown PGOS service, should be called during process shutdown if possible.
/// Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread.
/// </summary>
public void Destroy();
Parameters:
(No parameters)
Return: void