Login with Confirmation Code (LoginWithConfirmCode)
[Player Network SDK and MSDK] When a login or account binding attempt fails, you can retry the login using the confirmation code returned by the backend. This avoids requiring the user to reopen the authorization login interface.The confirmation code is returned by the backend.
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
void LoginWithConfirmCode(int actionType = 0, string confirmcode = "", string extraJson = "{}");
static void LoginWithConfirmCode(int32_t action_type = 0, const std::string &confirm_code = GUA_DEFAULT_EMPTY_STRING, const std::string &extra_json = GUA_DEFAULT_JSON_STRING);
Input Parameters
- Unity
- Unreal Engine
| Parameters | Type | Description |
|---|---|---|
| actionType | int | 0: General login 1: Bind channel account to current guest |
| confirmcode | string | Confirmation code provided by the server |
| extraJson | string | Extended Fields For more information, refer to the corresponding channel documentation. |
| Parameters | Type | Description |
|---|---|---|
| action_type | int32 | 0: General login 1: Bind channel account to current guest |
| confirm_code | std::string | Confirmation code provided by the server |
| extra_json | std::string | Extended Fields For more information, refer to the corresponding channel documentation. |
Callback Handling
The callback interface is GUALoginResultObservers.The callback data structure is GUALoginResult.
- Unity
- Unreal Engine
The callback event is LoginResultEvents. The callback ID is GUA_ACCOUNT_LOGIN_WITH_CONFIRM_CODE.
The callback event is OnLoginResultNotify. The callback ID is kMethodIDAccountLoginWelcomeConfirmationCode.
Code Example
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().LoginWithConfirmCode();
GUA_NAMESPACE::GUAAccountService::LoginWithConfirmCode();