Skip to main content

Verification code login (Login) [MSD only]

[MSD Only] To use email or phone number login with a verification code, you must first obtain the code via the send verification code interface, then call the Login interface and pass the 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 this blank ""
extraJsonstringExtended field, parameters for registration and login features
extraJson
{
"type": "register", // Login type - register
"account": "150xxxxxx87", // Account
"password": "123456678", // Password
"verifyCode": 12323, // Verification code
"extraJson": "", // Extended field used during registration, blank
"accountType": 2, // Account type, 1: email, 2: mobile phone
"langType": "zh_CN", // Language type, language of sent messages
"areaCode": "86" // Area code, required for mobile phone account; not required for email account
// For the areaCode field, the game should let the player choose, not type 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");