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
- Unity
- Unreal Engine
Supports
Android, iOS, Windows
platform.Supports
Android, iOS, Windows
platform.Function Definition
- Unity
- Unreal Engine
void Login(string channel, string permissions = "", string subChannel = "", string extraJson = "{}");
static void Login(const std::string &channel, const std::string &permissions = "", const std::string &sub_channel = "", const std::string &extra_json = "{}");
Input Parameters
- Unity
- Unreal Engine
Parameter | Type | Description |
---|---|---|
channel | string | [Required] Channel name "Self" for the custom channel |
permissions | string | Permission Pass an empty string "". |
subChannel | string | Sub channel Pass an empty string "". |
extraJson | string | The 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
}
Parameter | Type | Description |
---|---|---|
channel | string | [Required] Channel name "Self" for the custom channel |
permissions | string | Permission Pass an empty string "". |
subChannel | string | Sub channel Pass an empty string "". |
extraJson | string | The 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.
- Unity
- Unreal Engine
The callback event is LoginResultEvents. The callback methodID is GUA_ACCOUNT_LOGIN
.
The callback event is OnLoginResultNotify. The callback methodID is kMethodIDAccountLogin
.
Code Sample
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().Login("Self", "", "", "extraJson");
GUA_NAMESPACE::GUAAccountService::Login("Self", "", "", "extraJson");