Bind
AndroidiOSWindows
If you were looking for the method for use with Unreal Engine, see Bind for Unreal Engine SDK.
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
Parameter | Type | Description |
---|---|---|
channel | string | The specified channel to link. For more information, see INTLChannel. |
permissions | string | The authorized permissions list during linking. Separate the permissions by commas. Example: user_info,inapp_friends |
extraJson | string | The 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)
Parameter | Type | Description |
---|---|---|
type | string | login |
account | string | Account Can be an email address or phone number. |
accountType | int | Account type 1: email account 2: mobile account |
password | string | password |
phoneAreaCode | string | Phone 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)
Parameter | Type | Description |
---|---|---|
type | string | loginWithCode |
account | string | Account Can be an email address or phone number. |
accountType | int | Account type 1: email account 2: mobile account |
verifyCode | string | Verification code |
phoneAreaCode | string | Phone 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)
Parameter | Type | Description |
---|---|---|
type | string | register |
account | string | Account Can be an email address or phone number. |
accountType | int | Account type 1: email account 2: mobile account |
verifyCode | string | Verification code |
password | string | Password |
phoneAreaCode | string | Phone area code For example, "86" for China. If you register an account with an email address, the field is left empty. |
birthday | string | User's birthday For example, on December 31, 1970, fill in "1970-12-31". |
region | string | ISO 3166-1 numeric code for country or region For example 156 for China, 040 for Austria |
isReceiveEmail | int | Whether to receive the marketing emails 0: not receiving 1: receiving |
langType | string | Language type (RFC 4646) For example, "en" for English. For details, see Language Type Definition. |
username | string | Username, 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);