Switch account login
[Shared by Player Network SDK & MSDK] Choose to switch account login when encountering a different account.
Supported platforms
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.note
MSDK does not currently support Windows
Function Definition
- Unity
- Unreal Engine
bool SwitchUser(bool useLaunchUser);
static bool SwitchUser(bool use_launch_user);
Return Value
This API returns a bool value. true means success, false means unable to switch account.
Input Parameters
- Unity
- Unreal Engine
| Parameters | Type | Description |
|---|---|---|
| useLaunchUser | bool | Whether to switch account login |
| Parameters | Type | Description |
|---|---|---|
| use_launch_user | bool | Whether to switch account login |
Callback Handling
The callback handling interface is GUALoginResultObservers.The callback data structure is GUALoginResult.
- Unity
- Unreal Engine
The callback event is LoginResultEvents. The callback ID is GUA_ACCOUNT_SWITCH_USER.
The callback event is OnLoginResultNotify. The callback ID is kMethodIDAccountSwitchUser.
Code Example
- Unity
- Unreal Engine
bool isSucceeded = UnionAdapterAPI.GetAccountService().SwitchUser(true);
bool isSucceeded = GUA_NAMESPACE::GUAAccountService::SwitchUser(true);