AutoLogin
[Player Network SDK and MSDK] Automatically obtains the local authentication state, and validates the authentication state with the server. If there is no local cache of the authentication state, or the server fails to validate the authentication state, AutoLogin callback failure is returned.
[Player Network SDK Only] To access the custom account, call SetAccountInfo.
If games set LOGIN_NETWORK_ERROR_CLEAR_RESULT_ENABLE (INTL) or MSDK_LOGIN_NETWORK_ERROR_CLEAR_RET (MSDK) to false, when AutoLogin fails (for example, because the authentication token has expired), the returned GUALoginResult will contain the channel, channel ID, user name, and picture URL information of the previous AutoLogin account. Displaying these information will guide the user to log in again.
In addition, if the previous AutoLogin account used is a custom account, the additional JSON field of GUALoginResult will also include the account (such as the email or phone number used for registration).
Supported Platform
- Unity
- Unreal Engine
Android, iOS, Windows platform.Android, iOS, Windows platform.Function Definition
- Unity
- Unreal Engine
void AutoLogin();
static void AutoLogin();
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_AUTOLOGIN.
The callback event is OnLoginResultNotify.
The callback methodID is kMethodIDAccountAutoLogin.
Code Sample
- Unity
- Unreal Engine
UnionAdapterAPI.GetAccountService().AutoLogin();
GUA_NAMESPACE::GUAAccountService::AutoLogin();