检测登录 [仅限 MSDK]
[仅限 MSDK] 检查是否已生成 MSDK 账号,是则返回登录结果,没有生成过的话返回。
支持的平台
- Unity
- Unreal Engine
Supports
Android, iOS platform.Supports
Android, iOS platform.函数定义
- Unity
- Unreal Engine
void CheckLogin(string channel, string permissions = "", string subChannel = "", string extraJson = "");
static void CheckLogin(const std::string &channel, const std::string &permissions = "", const std::string &sub_channel = "", const std::string &extra_json = "");
入参说明
- Unity
- Unreal Engine
| 参数 | 类型 | 说明 |
|---|---|---|
| channel | string | 渠道名 如 "Facebook", "Twitter" |
| permissions | string | 授权权限列表,多个权限用逗号分隔 例如 user_info,inapp_friends 具体含义请查看各渠道说明 |
| subChannel | string | 子渠道名 |
| extraJson | string | 扩展字段 更多信息,请参见相对渠道说明。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| channel | std::string | 渠道名 如 "Facebook", "Twitter" |
| permissions | std::string | 授权权限列表,多个权限用逗号分隔 例如 user_info,inapp_friends 具体含义请查看各渠道说明 |
| sub_channel | std::string | 子渠道名 |
| extra_json | std::string | 扩展字段 更多信息,请参见相对渠道说明。 |
回调处理
回调处理接口是 GUALoginResultObservers。回调数据结构是 GUALoginResult。
- Unity
- Unreal Engine
回调事件是 LoginResultEvents。 回调 ID 是 GUA_ACCOUNT_CHECK_AND_LOGIN。
回调事件是 OnLoginResultNotify。 回调 ID 是 kMethodIDAccountCheck。
代码示例
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().CheckLogin("WeChat");
GUA_NAMESPACE::GUAAccountService::CheckLogin("WeChat");