SwitchUser
[Player Network SDK and MSDK] Switches the login account when there are different accounts.
Supported Platform
- Unity
- Unreal Engine
Supports
Android, iOS, Windows
platform.Supports
Android, iOS, Windows
platform.note
MSDK currently does not support Windows.
Function Definition
- Unity
- Unreal Engine
bool SwitchUser(bool useLaunchUser);
static bool SwitchUser(bool use_launch_user);
Return Value
This API returns bool value. true
indicates success, and false
indicates unable to switch accounts.
Input Parameters
- Unity
- Unreal Engine
Parameter | Type | Description |
---|---|---|
useLaunchUser | bool | Whether to switch accounts |
Parameter | Type | Description |
---|---|---|
use_launch_user | bool | Whether to switch accounts |
Callback Processing
The callback processing API is GUALoginResultObservers. The callback data structure is GUALoginResult.
- Unity
- Unreal Engine
The callback event is LoginResultEvents
.
The callback methodID is GUA_ACCOUNT_SWITCH_USER
.
The callback event is OnLoginResultNotify
.
The callback methodID is kMethodIDAccountSwitchUser
.
Code Sample
- Unity
- Unreal Engine
bool isSucceeded = UnionAdapterAPI.GetAccountService().SwitchUser(true);
bool isSucceeded = GUA_NAMESPACE::GUAAccountService::SwitchUser(true);