Password Login (LoginWithPassword) [Player Network SDK only]
[Player Network SDK only] Login via password.
Supported Platforms
- Unity
- Unreal Engine
Supports
Android, iOS, Windows platform.Supports
Android, iOS, Windows platform.Function Definition
- Unity
- Unreal Engine
void LoginWithPassword(
string channel,
string account,
string password,
string phoneAreaCode,
string permissionList = "");
static void LoginWithPassword(
const std::string &channel,
const std::string &account,
const std::string &password,
const std::string &phone_area_code,
const std::string &permission_list = GUA_DEFAULT_EMPTY_STRING);
Input Parameters
- Unity
- Unreal Engine
| Parameters | Type | Description |
|---|---|---|
| channel | string | Channel for self-built accounts related to platform accounts, such as CustomAccount, EGame. |
| account | string | Account, supporting email and phone number |
| password | string | For more information, see Password Guidelines. |
| phoneAreaCode | string | Phone area code example "86" for China, leave empty if the account is an email. |
| permissionList | string | List of permissions.Typically empty for self-built accounts. |
| Parameters | Type | Description |
|---|---|---|
| channel | std::string | A custom account channel associated with platform-specific accounts, such as CustomAccount, EGame, and others. |
| account | std::string | Account, supporting email and phone number |
| password | std::string | For more information, see Password Guidelines. |
| phone_area_code | std::string | Phone area code example "86" for China, leave empty if the account is an email. |
| permission_list | std::string | List of permissions.The custom account channel is typically empty. |
Callback Handling
The callback handling interface is GUALoginResultObservers.The callback data structure is GUALoginResult.
- Unity
- Unreal Engine
The callback event is LoginResultEvents. The callback ID is GUA_ACCOUNT_LOGIN.
The callback event is OnLoginResultNotify. The callback ID is kMethodIDAccountLogin.
Code Example
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().LoginWithPassword("WeChat", "account", "password", "86");
GUA_NAMESPACE::GUAAccountService::LoginWithPassword("WeChat", "Account", "PassWord", "86");