验证码登录(LoginWithVerifyCode)[仅限 Player Network SDK]
[仅限 Player Network SDK] 通过验证码登录。
支持的平台
- Unity
- Unreal Engine
支持
Android, iOS, Windows 平台。支持
Android, iOS, Windows 平台。函数定义
- Unity
- Unreal Engine
void LoginWithVerifyCode(
string channel,
string account,
string password,
string verifyCode,
string phoneAreaCode,
string permissionList = "");
static void LoginWithVerifyCode(
const std::string &channel,
const std::string &account,
const std::string &password,
const std::string &verify_code,
const std::string &phone_area_code,
const std::string &permission_list = "{}");
入参说明
- Unity
- Unreal Engine
| 参数 | 类型 | 说明 |
|---|---|---|
| channel | string | 自建账号的渠道,与平台账号相关,如 CustomAccount,EGame 等。 |
| account | string | 账号,支持邮箱和手机号 |
| password | string | 更多信息,请参见 密码规则。 |
| phoneAreaCode | string | 手机区域码例如中国为"86",如果账号为邮箱则填空。 |
| permissionList | string | 权限列表。自建账号一般为空。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| channel | std::string | 自建账号的渠道,与平台账号相关,如 CustomAccount,EGame 等。 |
| account | std::string | 账号,支持邮箱和手机号 |
| password | std::string | 更多信息,请参见 密码规则。 |
| phone_area_code | std::string | 手机区域码例如中国为"86",如果账号为邮箱则填空。 |
| permission_list | std::string | 权限列表。自建账号一般为空。 |
回调处理
回调处理接口是 GUALoginResultObservers。回调数据结构是 GUALoginResult。
- Unity
- Unreal Engine
回调事件是 LoginResultEvents。 回调 ID 是 GUA_ACCOUNT_LOGIN。
回调事件是 OnLoginResultNotify。 回调 ID 是 kMethodIDAccountLogin。
代码示例
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().LoginWithVerifyCode("WeChat", "account", "password", "verifyCode", "86");
GUA_NAMESPACE::GUAAccountService::LoginWithVerifyCode("WeChat", "Account", "PassWord", "VerifyCode", "86");