Skip to main content

Bind

AndroidiOSWindows
If you were looking for the method for use with Unity, see Bind for Unity 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

UFUNCTION(BlueprintCallable, Category = "INTLSDKAPI")
static bool Bind(
const EINTLLoginChannel Channel,
const FString permissions,
const FString extraJson);

Input parameters

ParameterTypeDescription
ChannelEINTLLoginChannelThe specified channel to link.
For more information, see EINTLLoginChannel.
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

Returns a bool type to indicate whether the current OS is supported.

Observers

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

The callback methodID is kMethodIDAuthBind.

Link third-party account

bool support = UINTLSDKAPI::Bind(EINTLLoginChannel::kChannelSteam);

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.
FString extra_json = "{\"type\":\"login\",\"account\":\"\",\"accountType\":1,\"phoneAreaCode\":\"\",\"password\":\"\"}";
UINTLSDKAPI::Bind(EINTLLoginChannel::kChannelCustomAccount, "", 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.
FString extra_json = "{\"type\":\"loginWithCode\",\"account\":\"\",\"accountType\":1,\"verifyCode\":\"\",\"phoneAreaCode\":\"\"}";
UINTLSDKAPI::Bind(EINTLLoginChannel::kChannelCustomAccount, "", 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.
FString extra_json = "{\"type\":\"register\",\"account\":\"\",\"accountType\":1,\"verifyCode\":\"\",\"password\":\"\",\"phoneAreaCode\":\"\",\"birthday\":\"1970-12-31\",\"region\":\"156\",\"isReceiveEmail\":\"0\",\"langType\":\"en\",\"username\":\"YOUR_USER_NAME\"}";
UINTLSDKAPI::Bind(EINTLLoginChannel::kChannelCustomAccount, "", extra_json);