Bind
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
Parameter | Type | Description |
---|---|---|
Channel | EINTLLoginChannel | The specified channel to link. For more information, see EINTLLoginChannel. |
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
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)
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. |
FString extra_json = "{\"type\":\"login\",\"account\":\"\",\"accountType\":1,\"phoneAreaCode\":\"\",\"password\":\"\"}";
UINTLSDKAPI::Bind(EINTLLoginChannel::kChannelCustomAccount, "", 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. |
FString extra_json = "{\"type\":\"loginWithCode\",\"account\":\"\",\"accountType\":1,\"verifyCode\":\"\",\"phoneAreaCode\":\"\"}";
UINTLSDKAPI::Bind(EINTLLoginChannel::kChannelCustomAccount, "", 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. |
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);