Skip to main content

Password Login (Login) [MSDK Only]

[MSDK Only] To use email or phone number login with account and password, you can call the Login interface and pass parameters in JSON format through extraJson. The specific parameters are described as follows.

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 ""
subChannelstringSubchannel
Leave blank ""
extraJsonstringExtension field, registration and login function parameters
extraJson
{
"type": "register", // Login type - Register
"account": "150xxxxxx87", // Account
"password": "123456678", // Password
"verifyCode": 12323, // Verification code
"extraJson": "", // Extended field used during registration, empty
"accountType": 2, // Account type, 1: Email, 2: Phone number
"langType": "zh_CN", // Language type, language for sending messages
"areaCode": "86" // Area code, required for phone accounts; optional for email accounts
// For the areaCode field, the game should let the player choose, not enter manually
}

Callback Handling

The callback processing 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");