Skip to main content

Client ClientSDK API Reference

Client sdk api.

API List

APIDescription
InitSdkInit modules for PGOS service. Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread.
InitConfigInit config for PGOS service Note: InitSdk/InitConfig/Tick/Destroy must be called on the main thread.
GetConfigGet configuration value of the specified key, except for "secret_key".
TickTick 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.
OnAppEnterForegroundShould be called when the application enters the foreground. (for Android&iOS)
OnAppEnterBackgroundShould be called when the application enters the background. (for Android&iOS).
GetSDKVersionGet current PGOS SDK version.
DestroyShutdown 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:

ParamTypeDescription
pgos_paramsInitSdkParamsRequest 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:

ParamTypeDescription
cfgsDictionary<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:

ParamTypeDescription
cfg_keystringThe 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