Skip to main content

Query if binding is possible (QueryCanBind)

AndroidiOSWindows
If you're using the Unreal Engine, see the QueryCanBind for the Unreal Engine SDK.

Query if binding is possible, currently only supports self-built accounts.

Depending on whether the account is registered, the callback data AccountResult will have its member variables as follows:

  1. Account not registered:
    • can_bind returns true
    • is_register returns false.
  2. Account already registered:
    • is_register returns true.
    • If logged in and bound (with OpenID), can_bind returns false.
    • If not logged in and bound (without OpenID), can_bind returns true.

Function Definition

public static void QueryCanBind(int channelId, int accountPlatType, string account, string phoneAreaCode, string extraJson = "{}");

Parameter Details

NameTypeExplanation
channelIdintSelf-hosted account channel ID
ACCOUNT_PLAT_TYPE assigned by Player Network Console
accountPlatTypeintPlatform type ID corresponding to the channel
accountstringAccount
Support for email and phone number
phoneAreaCodestringPhone area code
For example, "86" for China, if registering with email, the field is empty
extraJsonstringAdditional information

Return value

No return value.

Observers

The callback handler interface is AuthAccountResultObserver.The callback data structure is AccountResult.

Callback ID is INTL_AUTH_QUERY_CAN_BIND.

Code sample

int channelid = 11;
int accountPlatType = 3;
string account = "youremail@sample.com";
string phoneAreaCode = "";
string extraJson = "";
INTLAPI.Instance.QueryCanBind(channelid, accountPlatType, account, phoneAreaCode, extraJson);