Skip to main content

Register and Login [MSDK Only]

[MSDK Only] To use email or phone number registration and login for self-built accounts, you can call the Login interface and pass parameters in JSON format through extraJson.

Supported platforms

Supports Android, iOS, Windows platform.

Function Definition

void Login(string channel, string permissions = "", string subChannel = "", string extraJson = "{}");

Input Parameters

ParametersTypeDescription
channelstring[Required] Channel name
"Self" refers to the custom channel
permissionsstringPermissions
Leave blank ""
subChannelstringSub-channel
Leave blank ""
extraJsonstringExtension field, registration and login function parameters
extraJson
{
"type": "register", // Login type - registration
"account": "150xxxxxx87", // Account
"password": "123456678", // Password
"verifyCode": 12323, // Verification code
"extraJson": "", // Extension field used during registration, empty
"accountType": 2, // Account type, 1: email, 2: mobile number
"langType": "zh_CN", // Language type, language of messages sent
"areaCode": "86" // Area code, must be filled for mobile number accounts; for email accounts, area code is optional
// For the areaCode field, the game should let the player choose, not enter manually
}

Callback Handling

The callback handler interface is GUALoginResultObservers.The callback data structure is GUALoginResult.

The callback event is LoginResultEvents.The callback ID is GUA_ACCOUNT_LOGIN.

Code Example

UnionAdapterAPI.GetAccountService().Login("Self", "", "", "extraJson");