Skip to main content

SwitchUser

[Player Network SDK and MSDK] Switches the login account when there are different accounts.

Supported Platform

Supports Android, iOS, Windows platform.
note

MSDK currently does not support Windows.

Function Definition

bool SwitchUser(bool useLaunchUser);

Return Value

This API returns bool value. true indicates success, and false indicates unable to switch accounts.

Input Parameters

ParameterTypeDescription
useLaunchUserboolWhether to switch accounts

Callback Processing

The callback processing API is GUALoginResultObservers. The callback data structure is GUALoginResult.

The callback event is LoginResultEvents. The callback methodID is GUA_ACCOUNT_SWITCH_USER.

Code Sample

bool isSucceeded = UnionAdapterAPI.GetAccountService().SwitchUser(true);