Skip to main content

Bind

AndroidiOSWindows
If you were looking for the method for use with Unreal Engine, see Bind for Unreal Engine SDK.

Links the third-party channel to the guest account. It ensures various third-party channels share a single Player Network SDK OpenID.
It is generally used to link Facebook or Google accounts to existing guest accounts in a game.

Function definition

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

Input parameters

ParameterTypeDescription
channelstringThe specified channel to link.
For more information, see INTLChannel.
permissionsstringThe authorized permissions list during linking. Separate the permissions by commas.
Example: user_info,inapp_friends
extraJsonstringThe extended field.
For more information, see relative channel descriptions.

Return value

No return value.

Observers

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

The callback methodID is INTL_AUTH_BIND.

Link third-party account

INTLAPI.Bind(INTLChannel.Facebook);

Link custom account (Log in with password)

ParameterTypeDescription
typestringlogin
accountstringAccount
Can be an email address or phone number.
accountTypeintAccount type
1: email account
2: mobile account
passwordstringpassword
phoneAreaCodestringPhone Area code
For example, "86" for China.
If you register an account with an email address, the field is left empty.
string extra_json = "{\"type\":\"login\",\"account\":\"\",\"accountType\":1,\"phoneAreaCode\":\"\",\"password\":\"\"}";
INTLAPI.Bind(INTLChannel.CustomAccount, "", extra_json);

Link custom account (Log in with verification code)

ParameterTypeDescription
typestringloginWithCode
accountstringAccount
Can be an email address or phone number.
accountTypeintAccount type
1: email account
2: mobile account
verifyCodestringVerification code
phoneAreaCodestringPhone area code
For example, "86" for China.
If you register an account with an email address, the field is left empty.
string extra_json = "{\"type\":\"loginWithCode\",\"account\":\"\",\"accountType\":1,\"verifyCode\":\"\",\"phoneAreaCode\":\"\"}";
INTLAPI.Bind(INTLChannel.CustomAccount, "", extra_json);

Link custom account (Register)

ParameterTypeDescription
typestringregister
accountstringAccount
Can be an email address or phone number.
accountTypeintAccount type
1: email account
2: mobile account
verifyCodestringVerification code
passwordstringPassword
phoneAreaCodestringPhone area code
For example, "86" for China.
If you register an account with an email address, the field is left empty.
birthdaystringUser's birthday
For example, on December 31, 1970, fill in "1970-12-31".
regionstringISO 3166-1 numeric code for country or region
For example 156 for China, 040 for Austria
isReceiveEmailintWhether to receive the marketing emails
0: not receiving
1: receiving
langTypestringLanguage type (RFC 4646)
For example, "en" for English. For details, see Language Type Definition.
usernamestringUsername, which must start with a letter and only contains lowercase letters (from a to z), underscores (_), and digits (from 0 to 9). Its 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);