Skip to main content

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.

note

[Player Network SDK Only] To access the custom account, call SetAccountInfo.

note

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

Supports Android, iOS, Windows platform.

Function Definition

void AutoLogin();

Callback Processing

The callback processing API is GUALoginResultObservers. The callback data structure is GUALoginResult.

The callback event is LoginResultEvents. The callback methodID is GUA_ACCOUNT_AUTOLOGIN.

Code Sample

UnionAdapterAPI.GetAccountService().AutoLogin();