Skip to main content

InitCustomer

AndroidiOSWindows
If you were looking for the method for use with Unity, see InitCustomer for Unity SDK.

Initializes the customer service. The asynchronous callback must be received before users call other APIs.

Function definition

UFUNCTION(BlueprintCallable, Category = "INTLSDKAPI")
static void InitCustomer(FINTLCustomerUserProfile &userProfile);

Input parameters

NameTypeDescription
userProfileFINTLCustomerUserProfileCustomer service module request body, mainly including important input parameters such as language type and channel ID

CustomerUserProfile

Member variableTypeDescriptionRemarks
langTypeFStringSDK language. Specifies the language, which should follow the RFC 4646 standard, such as: en. For details, see Language Type DefinitionsRequired
signFStringApp configurationRequired
openIdFStringUnique user IDRequired
nickNameFStringRole nicknameRequired
gameLevelFStringGame levelOptional
roleIdFStringRole ID, used to locate issues for customer serviceOptional
areaIdFStringGame region ID, used to locate issues for customer serviceOptional
zoneIdFStringGame zone ID, used to locate issues for customer serviceOptional
serverIdFStringGame server ID, used to locate issues for customer serviceOptional
regionstringISO 3166-1 numeric code for country or region
For example 156 for China, 040 for Austria
Optional
pictureUrlFStringAvatar linkOptional
customParam1FStringuser tags, string of array, multiple tags are separated by ",", the default is an empty string, e.g: "recharge,suggestion"Optional
customParam2FStringcustom data, json string, the default is an empty string, e.g: "{\"level\" : 34, \"total_recharge\" : 300}"Optional
customParam3FStringSpare parameter which is not in useOptional
customParam4FStringSpare parameter which is not in useOptional
customParam5FStringSpare parameter which is not in useOptional
info
  • When any one of langType, sign, openId, and nickName of userProfile is empty, the "INVALID_ARGUMENT" error will be triggered and the client error code is 11.
  • When an HTML5 request fails, the "UNKNOWN" error will be triggered and the client error code is -1.

Observers

The callback processing API is CustomerResultObserver.
The callback data structure is CustomerResult.

The callback methodID is kMethodIDCustomerInit.

Code sample

FINTLCustomerUserProfile userProfile = new FINTLCustomerUserProfile
(
"zh-Hans",
"YOUR_SIGN",
"openid",
"1",
"player1",
"",
"",
"",
"",
"",
"https://head.xxx.com/xx.png",
"recharge,suggestion",
"{\"level\" : 34, \"total_recharge\" : 300}"
);
UINTLSDKAPI::InitCustomer(userProfile);