Skip to main content

Bind (Bind)

AndroidiOSPC

If you are using Unreal Engine, please refer to Bind for the Unreal Engine SDK.

Bind a third-party channel to the guest account.It essentially means multiple third-party accounts share the same Player Network SDK OpenID.
The common usage scenario is: Guest logs into the game and then binds Facebook or Google account.

Function definition​

public static void Bind(string channel, string permissions = "", string extraJson = "{}");

Parameter Instructions​

ParametersTypeDescription
channelstringSpecifies the bound channel.
For more information, see INTLChannel.
permissionsstringAuthorization permission list during binding, separate multiple permissions with commas
For example: user_info,inapp_friends
extraJsonstringExtension fields
For more information, refer to relative channel description.

Return Value​

No return value.

Callback processing​

The callback handler interface is AuthResultObserver.The callback data structure is AuthResult.

The callback methodID is INTL_AUTH_BIND.

Bind Third-Party Channel Account​

INTLAPI.Bind(INTLChannel.Facebook);

Bind Custom Account (Password Login Binding)​

ParametersTypeDescription
CategorystringLogin
accountstringAccount
Supports email and phone
accountTypeintAccount Type
1: Email Account
2: Phone Account
passwordstringPassword
phoneAreaCodestringPhone area code
For example, "86" is China.
If registering the account with an email address, this field is empty.
string extra_json = "{\"type\":\"login\",\"account\":\"\",\"accountType\":1,\"phoneAreaCode\":\"\",\"password\":\"\"}";
INTLAPI.Bind(INTLChannel.CustomAccount, "", extra_json);

Bind Custom Account (Verification Code Login Binding)​

ParametersTypeDescription
CategorystringloginWithCode
accountstringAccount
Supports email and phone
accountTypeintAccount Type
1: Email Account
2: Phone Account
verifyCodestringVerification Code
phoneAreaCodestringPhone area code
For example, "86" is China.
If registering the account with an email address, this field is empty.
string extra_json = "{\"type\":\"loginWithCode\",\"account\":\"\",\"accountType\":1,\"verifyCode\":\"\",\"phoneAreaCode\":\"\"}";
INTLAPI.Bind(INTLChannel.CustomAccount, "", extra_json);

Bind Custom Account (Registration)​

ParametersTypeDescription
Categorystringregister
accountstringAccount
Supports email and phone
accountTypeintAccount Type
1: Email Account
2: Phone Account
verifyCodestringVerification Code
passwordstringPassword
phoneAreaCodestringPhone area code
For example, "86" is China.
If registering the account with an email address, this field is empty.
birthdaystringUser's birthday
For example, December 31, 1970, enter "1970-12-31".
regionstringISO 3166-1 Numeric code for a country or region
For example, 156 represents China, and 040 represents Austria
isReceiveEmailintReceive marketing emails
0: Do not receive marketing emails
1: Receive marketing emails
langTypestringLanguage Type (RFC 4646)
For example, "en" represents English.For details, see Language Type Definition.
usernamestringUsername, must start with a letter, containing only lowercase letters (from a to z), underscores (_) and numbers (from 0 to 9).Length can be 6 to 16 letters.
string extra_json = "{\"type\":\"register\",\"account\":\"\",\"accountType\":1,\"verifyCode\":\"\",\"password\":\"\",\"phoneAreaCode\":\"\",\"birthday\":\"1970-12-31\",\"region\":\"156\",\"isReceiveEmail\":\"0\",\"langType\":\"en\",\"username\":\"YOUR_USER_NAME\"}";
INTLAPI.Bind(INTLChannel.CustomAccount, "", extra_json);