Register and log in (Register) [Player Network SDK only]
[Player Network SDK only] Register and log in to the account.
Supported platforms
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.Function Definition
- Unity
- Unreal Engine
void Register(
string account,
string password,
string verifyCode,
string phoneAreaCode,
GUAAccountProfile userProfile,
string extraJson = "{}" );
static void Register(
const std::string &account,
const std::string &password,
const std::string &verify_code,
const std::string &phone_area_code,
const GUAAccountProfile &user_profile,
const std::string &extra_json = GUA_DEFAULT_JSON_STRING);
Input Parameters
note
Please refer to the rules for username and password.
- Unity
- Unreal Engine
| Parameters | Type | Description |
|---|---|---|
| account | String | Account, Can be registered using an email or phone number |
| password | String | For more information, see Password Guidelines. |
| verifyCode | String | Verification Code |
| phoneAreaCode | String | Phone Area Code: For example, China is "86". Leave empty if the account is an email. |
| userProfile | GUAAccountProfile | Account Personal Information: Includes username, date of birth, country/region, etc. |
| extraJson | string | Extended Information |
| Parameters | Type | Description |
|---|---|---|
| account | std::string | Account, Can be registered using either an email or a phone number |
| password | std::string | For more information, see Password Guidelines. |
| verify_code | std::string | Verification Code |
| phone_area_code | std::string | Phone Area Code: For example, China is "86". Leave empty if the account is an email. |
| user_profile | GUAAccountProfile | Account Personal Information: Includes username, date of birth, country/region, etc. |
| extra_json | std::string | Extended information |
Observers
The callback handler interface is GUALoginResultObservers.The callback data structure is GUALoginResult.
- Unity
- Unreal Engine
The callback event is LoginResultEvents. The callback ID is GUA_ACCOUNT_REGISTER.
The callback event is OnLoginResultNotify. The callback ID is kMethodIDAccountRegister.
Code sample
- Unity
- Unreal Engine
GUAAccountProfile accountProfile = new GUAAccountProfile();
// TODO: Set accountProfile
UnionAdapterAPI.GetAccountService().Register("account", "password", "verifyCode", "86", accountProfile);
GUA_NAMESPACE::GUAAccountProfile AccountProfile;
// TODO: Set AccountProfile
GUA_NAMESPACE::GUAAccountService::Register("Account", "PassWord", "VerifyCode", "86", AccountProfile);