LoginWithConfirmCode
[Player Network SDK and MSDK] When the login or linking fails, try to log in again with the confirmation code to prevent the user from opening the login interface again. The confirmation code is returned in the backend.
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
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
| Parameter | Type | Description |
|---|---|---|
| actionType | int | 0: General login 1: Links the channel account to the current guest account. |
| confirmcode | string | The confirmation code generated by the server. |
| extraJson | string | The extended field. For more information, see relative channel descriptions. |
| Parameter | Type | Description |
|---|---|---|
| action_type | int32 | 0: General login 1: Links the channel account to the current guest account. |
| confirm_code | std::string | The confirmation code generated by the server. |
| extra_json | std::string | The extended field. For more information, see relative channel descriptions. |
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_LOGIN_WITH_CONFIRM_CODE.
The callback event is OnLoginResultNotify.
The callback methodID is kMethodIDAccountLoginWithConfirmCode.
Code Sample
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().LoginWithConfirmCode();
GUA_NAMESPACE::GUAAccountService::LoginWithConfirmCode();