使用确认码登录(LoginWithConfirmCode)
[Player Network SDK 和 MSDK] 当登录或者绑定失败后,通过后台返回的确认码再次尝试登录,避免让用户再次拉起授权登录界面。确认码在后台回.
支持的平台
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.note
MSDK 暂不支持 Windows
函数定义
- 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);
入参说明
- Unity
- Unreal Engine
| 参数 | 类型 | 说明 |
|---|---|---|
| actionType | int | 0:一般登录 1:将渠道账号绑定到当前游客 |
| confirmcode | string | 服务器给出的确认码 |
| extraJson | string | 扩展字段 更多信息,请参见相对渠道说明。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| action_type | int32 | 0:一般登录 1:将渠道账号绑定到当前游客 |
| confirm_code | std::string | 服务器给出的确认码 |
| extra_json | std::string | 扩展字段 更多信息,请参见相对渠道说明。 |
回调处理
回调处理接口是 GUALoginResultObservers。回调数据结构是 GUALoginResult。
- Unity
- Unreal Engine
回调事件是 LoginResultEvents。 回调 ID 是 GUA_ACCOUNT_LOGIN_WITH_CONFIRM_CODE。
回调事件是 OnLoginResultNotify。 回调 ID 是 kMethodIDAccountLoginWelcome确认代码。
代码示例
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().LoginWithConfirmCode();
GUA_NAMESPACE::GUAAccountService::LoginWithConfirmCode();