Skip to main content

Log In with Verification Code (Login) [MSDK Only]

[MSDK Only] To login through email or phone number with the verification code, call Login and pass JSON format parameters in the extraJson field.

Supported Platform​

Supports Android, iOS, Windows platform.

Function Definition​

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

Input Parameters​

ParameterTypeDescription
channelstring[Required] Channel name
"Self" for the custom channel
permissionsstringPermission
Pass an empty string "".
subChannelstringSub channel
Pass an empty string "".
extraJsonstringThe extended field for register and login parameters
extraJson
{
"type": "register", // Login type - register
"account": "150xxxxxx87", // Account
"password": "123456678", // Password
"verifyCode": 12323, // Verification code
"extraJson": "", // The extended field for register and login parameters, empty
"accountType": 2, // Account type: 1: email; 2: phone number
"langType": "zh_CN", // Language type, the language used to send the message
"areaCode": "86" // Area code, for phone number accounts, area code is mandatory; for email account, area code can be left empty
// For areaCode field, games should promt the player to select rather than enter manually
}

Callback Processing​

The callback processing API is GUALoginResultObservers. The callback data structure is GUALoginResult.

The callback event is LoginResultEvents. The callback methodID is GUA_ACCOUNT_LOGIN.

Code Sample​

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