Query if binding is possible (QueryCanBind) [Player Network SDK only]
[Player Network SDK Only] Query whether binding is allowed. Currently, only self-built accounts are supported.
According to whether the account is registered, the member variables in the callback data GUAAccountResult will be as follows:
- Account not registered:
can_bindreturnstrueis_registerreturnsfalse.
- Account already registered:
is_registerreturns true.- If logged in and bound (with OpenID),
can_bindreturnsfalse. - If there is no login binding (no OpenID),
can_bindreturnstrue.
Supported Platforms
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.Function Definition
- Unity
- Unreal Engine
void QueryCanBind(int channelid, int accountPlatType, string account, string phoneAreaCode, string extraJson = "{}");
static void QueryCanBind(
int32_t channelid,
int32_t account_plat_type,
const std::string &account,
const std::string &phone_area_code,
const std::string &extra_json = "{}");
Input Parameters
- Unity
- Unreal Engine
| Parameters | Type | Description |
|---|---|---|
| channelid | int | Custom Account Channel Assigned by the Player Network Console: [ACCOUNT_PLAT_TYPE(/docs/pntconsole/configuration/ConfigureLIPASS#parameters) |
| accountPlatType | int | Platform Type ID corresponding to the channel ID |
| account | string | Account Supports email and phone |
| phoneAreaCode | string | Phone area code For example, "86" for China, if registering with email, the field is empty |
| extraJson | string | Extended information |
| Parameters | Type | Description |
|---|---|---|
| channelid | int32_t | Custom Account Channel Assigned by the Player Network Console: [ACCOUNT_PLAT_TYPE(/docs/pntconsole/configuration/ConfigureLIPASS#parameters) |
| account_plat_type | int32_t | Platform Type ID corresponding to the channel ID |
| account | std::string | Account Supports email and phone |
| phone_area_code | std::string | Phone area code For example, "86" for China, if registering with email, the field is empty |
| extra_json | std::string | Extended information |
Callback Handling
The callback processing interface is GUAAccountResultObservers.The callback data structure is GUAAccountResult.
- Unity
- Unreal Engine
The callback event is AccountEvents. Callback ID is GUA_ACCOUNT_QUERY_CAN_BIND.
The callback event is OnAccountResultNotify. Callback ID is kMethodIDAccountQueryCanBind.
Code Example
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().QueryCanBind(1, 1, "account", "86");
GUA_NAMESPACE::GUAAccountService::QueryCanBind(1, 1, "Account", "86");