查询是否可以绑定(QueryCanBind)
查询是否可以绑定,目前只支持自建账号。
根据账号是否已注册回调数据 AccountResult 的成员变量会如下:
- 账号没有注册:
can_bind返回trueis_register返回false。
- 账号已经注册:
is_register返回 true。- 若登录绑定 (有 OpenID),
can_bind返回false。 - 若没有登录绑定 (没有 OpenID),
can_bind返回true。
函数定义
UFUNCTION(BlueprintCallable, Category = "INTLSDKAPI")
static bool QueryCanBind(
const int32 ChannelId,
const int32 AccountPlatType,
const FString Account,
const FString PhoneAreaCode,
const FString ExtraJson = "{}");
入参说明
| 名称 | 类型 | 说明 |
|---|---|---|
| ChannelId | int32 | 自建账号渠道 ID Player Network 控制台分配的 ACCOUNT_PLAT_TYPE |
| AccountPlatType | int32 | 对应渠道的平台类型 ID |
| 账号 | FString | 账号 支持邮箱和手机号 |
| PhoneAreaCode | FString | 手机区域码 例如 "86" 为中国,如果用邮件地址注册账号,字段则为空 |
| ExtraJson | FString | 扩展信息 |
返回值
回调 ID 是 kMethodIDAuthLaunchAccountUI。
回调处理
回调处理接口是 AuthAccountResultObserver。回调数据结构是 AccountResult。
回调 ID 是 kMethodIDAuthQueryCanBind。
代码示例
bool support = UINTLSDKAPI::QueryCanBind(11, 3, "youremail@sample.com", "");