InitCustomer
AndroidiOSWindows
If you were looking for the method for use with Unreal Engine, see InitCustomer for Unreal Engine SDK.
If you were looking for the method for use with Unreal Engine, see InitCustomer for Unreal Engine SDK.
Initializes the customer service. The asynchronous callback must be received before users call other APIs.
Function definition
public void InitCustomer(INTLCustomerUserProfile userProfile);
Input parameters
Name | Type | Description |
---|---|---|
userProfile | INTLCustomerUserProfile | Customer service module request body, mainly including important input parameters such as language type and channel ID |
CustomerUserProfile
Member variable | Type | Description | Remarks |
---|---|---|---|
langType | string | SDK language. Specifies the language, which should follow the RFC 4646 standard, such as: en. For details, see Language Type Definitions | Required |
sign | string | App configuration | Required |
openId | string | Unique user ID | Required |
nickName | string | Role nickname | Required |
gameLevel | string | Game level | Optional |
roleId | string | Role ID, used to locate issues for customer service | Optional |
areaId | string | Game region ID, used to locate issues for customer service | Optional |
zoneId | string | Game zone ID, used to locate issues for customer service | Optional |
serverId | string | Game server ID, used to locate issues for customer service | Optional |
region | string | ISO 3166-1 numeric code for country or region For example 156 for China, 040 for Austria | Optional |
pictureUrl | string | Avatar link | Optional |
customParam1 | string | user tags, string of array, multiple tags are separated by ",", the default is an empty string, e.g: "recharge,suggestion" | Optional |
customParam2 | string | custom data, json string, the default is an empty string, e.g: "{\"level\" : 34, \"total_recharge\" : 300}" | Optional |
customParam3 | string | Spare parameter which is not in use | Optional |
customParam4 | string | Spare parameter which is not in use | Optional |
customParam5 | string | Spare parameter which is not in use | Optional |
info
- When any one of
langType
,sign
,openId
, andnickName
ofuserProfile
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.
Callback Processing
The callback processing API is CustomerResultObserver.
The callback data structure is CustomerResult.
The callback methodID 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);