Skip to main content

Initialize Customer Service (InitCustomer)

AndroidiOSWindows
If you are using Unreal Engine, please refer to InitCustomer in the Unreal Engine SDK.

Initialize Customer Service.Users must receive the asynchronous callback before calling other interfaces.

Function Definition

public void InitCustomer(INTLCustomerUserProfile userProfile);

Input Parameters

NameTypeExplanation
userProfileINTLCustomerUserProfileCustomer module request structure, mainly includes important input parameters such as language type and channel identifier

CustomerUserProfile

Member variableTypeExplanationNote
langTypestringSDK language; the language type follows the RFC 4646 standard, such as: en. For details, please refer to Language Type DefinitionRequired
signStringApplication configurationRequired
openIdstringPlayer Network SDK user unique identifierRequired
nickNamestringRole nicknameRequired
gameLevelStringGame levelOptional
roleIdStringRole ID, for customer service to locate issuesOptional
areaIdStringGame area ID, for customer service to locate issuesOptional
zoneIdStringGame zone ID, for customer service to locate issuesOptional
serverIdStringGame server ID, for customer service to locate issuesOptional
regionStringThe numeric code for a country or region according to ISO 3166-1
For example, 156 represents China, and 040 represents Austria.
Optional
pictureUrlStringProfile picture URLOptional
customParam1StringUser tags, string in array. Separate multiple tags with ", ". Default is an empty string. For example: "recharge,suggestion"Optional
customParam2stringCustom data, JSON string. Default is an empty string. For example: {"level" : 34, "total_recharge" : 300}Optional
customParam3stringUnused reserved parameterOptional
customParam4StringUnused reserved parameterOptional
customParam5StringUnused reserved parameterOptional
info
  • If any of langType, sign, openId, or nickName in userProfile is empty, an "INVALID_ARGUMENT" error will be triggered. The Client Error Code is 11.
  • If an H5 request fails, an "UNKNOWN" error will be triggered. The Client Error Code is -1.

Callback processing

The callback handling interface is CustomerResultObserver.
The callback data structure is CustomerResult.

The callback ID is INTL_CUSTOMER_INIT.

Code Sample

var userProfile = new INTLCustomerUserProfile
{
LangType = "zh-Hans",
Sign = "YOUR_SIGN",
OpenId = "openid",
GameLevel = "1",
NickName = "player1",
RoleId = "",
AreaId = "",
ZoneId = "",
ServerId = "",
Region = "",
PictureUrl = "https://head.xxx.com/xx.png",
CustomParam1 = "recharge,suggestion",
CustomParam2 = "{\"level\" : 34, \"total_recharge\" : 300}"
};
INTLAPI.InitCustomer(userProfile);