getUserStatus
Introduction
Get the online status of the users.
Parameter details
Parameter name |
Parameter type |
Required |
Description |
userIDList |
string[] |
yes |
The list of users needs to query. |
Returned template
V2TimValueCallback<V2TimUserStatus[]>
{
code : number
desc : string
data : V2TimUserStatus[]
}
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 |
V2TimUserStatus[] |
The list of online status results. |
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const userIDList = [];
const getUserStatusRes = await TencentImSDKPlugin.v2TIMManager.getUserStatus(
userIDList
);
if (getUserStatusRes.code === 0) {
getUserStatusRes.data?.forEach((element) => {
element.customStatus;
element.statusType;
element.userID;
});
}