Updated on 2025-07-28 GMT+08:00

Obtaining the Login Status

Function

This API is used to obtain the login status.

Function Prototype

getLoginState(onGetLoginStateResult?: (ret: SDKERR, reason: string, loginStateInfo: LoginStateInfo) => void): voidgetLoginState(onGetLoginStateResult?: (ret: SDKERR, reason: string, loginStateInfo: LoginStateInfo) => void): void

Request Parameters

Table 1 Input parameter description
Parameter Mandatory Type Description
onGetLoginStateResult Yes (ret: SDKERR, reason: string, loginStateInfo: LoginStateInfo) => void Callback of the API for obtaining the login status.

Return Values

void

Callback Method Parameters

(ret: SDKERR, reason: string, loginStateInfo: LoginStateInfo) => void

Table 2 Input parameter description
Parameter Type Description
ret For details about SDKERR, see Error Code Reference. Error code.
reason string Error description.
loginStateInfo LoginStateInfo Login status information.
Table 3 LoginStateInfo
Parameter Type Description
loginState LoginState Login mode.
Table 4 Enumerated values of LoginState
Enumeration Name Enumerated Value Description
LOGIN_STATUS_UN_LOGIN 0 Logged out.
LOGIN_STATUS_LOGINING 1 Logging in.
LOGIN_STATUS_LOGINED 2 Logged in.
LOGIN_STATUS_LOGOUTING 3 Logging out.