getLoginStatus
Introduction
Get the login status.
Please do not call the login method frequently, if user is already logged in or in the status of logging in.
Parameter details
This API has no parameters
Returned template
V2TimValueCallback<number>
{
code : number
desc : string
data : number// The login status of the current user
}
Return value details
name | type | description |
---|---|---|
code | number | Request result: Error codes. 0 means success. |
desc | string | The description of the error. It will be empty if success. |
data | number | The login status of the current user |
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const getLoginStatusRes =
await TencentImSDKPlugin.v2TIMManager.getLoginStatus();
if (getLoginStatusRes.code === 0) {
const status = getLoginStatusRes.data;
if (status === 1) {
} else if (status === 2) {
} else if (status === 3) {
}
}