Register [Player Network SDK Only]
[Player Network SDK Only] Register and log in to the account.
Supported Platform
- 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
Take note about the username and password rule.
- Unity
- Unreal Engine
| Parameter | Type | Description |
|---|---|---|
| account | string | Account, which can be registered with an email address or phone number. |
| password | string | Password. For more information, see Password Rules. |
| verifyCode | string | Verification code |
| phoneAreaCode | string | Phone area code, such as "86" for China. If you register an account with an email address, the field is left empty. |
| userProfile | GUAAccountProfile | Personal information, such as user name, birthday and more. |
| extraJson | string | Extended information |
| Parameter | Type | Description |
|---|---|---|
| account | std::string | Account, which can be registered with an email address or phone number. |
| password | std::string | Password. For more information, see Password Rules. |
| verify_code | std::string | Verification code |
| phone_area_code | std::string | Phone area code, such as "86" for China. If you register an account with an email address, the field is left empty. |
| user_profile | GUAAccountProfile | Personal information, such as user name, birthday and more. |
| extra_json | std::string | Extended information |
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_REGISTER.
The callback event is OnLoginResultNotify.
The callback methodID 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);