Initialize Customer Service (InitCustomer)
AndroidiOSWindows
If you are using Unreal Engine, please refer to InitCustomer in the Unreal Engine SDK.
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
| Name | Type | Explanation |
|---|---|---|
| userProfile | INTLCustomerUserProfile | Customer module request structure, mainly includes important input parameters such as language type and channel identifier |
CustomerUserProfile
| Member variable | Type | Explanation | Note |
|---|---|---|---|
| langType | string | SDK language; the language type follows the RFC 4646 standard, such as: en. For details, please refer to Language Type Definition | Required |
| sign | String | Application configuration | Required |
| openId | string | Player Network SDK user unique identifier | Required |
| nickName | string | Role nickname | Required |
| gameLevel | String | Game level | Optional |
| roleId | String | Role ID, for customer service to locate issues | Optional |
| areaId | String | Game area ID, for customer service to locate issues | Optional |
| zoneId | String | Game zone ID, for customer service to locate issues | Optional |
| serverId | String | Game server ID, for customer service to locate issues | Optional |
| region | String | The numeric code for a country or region according to ISO 3166-1 For example, 156 represents China, and 040 represents Austria. | Optional |
| pictureUrl | String | Profile picture URL | Optional |
| customParam1 | String | User tags, string in array. Separate multiple tags with ", ". Default is an empty string. For example: "recharge,suggestion" | Optional |
| customParam2 | string | Custom data, JSON string. Default is an empty string. For example: {"level" : 34, "total_recharge" : 300} | Optional |
| customParam3 | string | Unused reserved parameter | Optional |
| customParam4 | String | Unused reserved parameter | Optional |
| customParam5 | String | Unused reserved parameter | Optional |
info
- If any of
langType,sign,openId, ornickNameinuserProfileis 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);