getSubscribeUsersStatus
Feature Introduction
Description
Obtain the online status of all subscribed users.
Note
When obtaining the online status of all subscribed users, a maximum of 3000 can be returned at once.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<UserStatusInfo>> getSubscribeUsersStatus({
String? operationID,
})
Input Parameters
None
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
then | List<UserStatusInfo > | Successful callback |
onError | Function | Failure callback |
Code Example
await OpenIM.iMManager.userManager.getSubscribeUsersStatus();
// todo
Function Prototype
- (void)getSubscribeUsersStatusWithOnSuccess:(nullable OIMUserStatusInfosCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
None
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | NSArray<OIMUserStatusInfo *> | Success |
onFailure | OIMFailureCallback | Failure |
Code Example
[OIMManager.manager getSubscribeUsersStatusWithOnSuccess:^(NSArray<OIMUserStatusInfo *> * _Nullable statusInfos) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getSubscribeOnlineUsersStatus(OnBase<List<UsersOnlineStatus>> callBack)
Input Parameters
None
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
callBack | OnBase<List<UsersOnlineStatus>> | Successful callback |
Code Example
OpenIMClient.getInstance()
.userInfoManager.getSubscribeOnlineUsersStatus(new OnBase<List<UsersOnlineStatus>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<UsersOnlineStatus> data) {
// todo
}
});
Function Prototype
IMSDK.getSubscribeUsersStatus(operationID?: string): Promise<WsResponse<UserOnlineState[]>>
Input Parameters
None
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<UserOnlineState[]>> | List of user online status |
Promise.catch() | Promise<WsResponse> | Failure callback |
Code Example
import { getSDK } from '@openim/wasm-client-sdk';
const IMSDK = getSDK();
// use in electron with ffi
// import { getWithRenderProcess } from '@openim/electron-client-sdk/lib/render';
// const { instance: IMSDK } = getWithRenderProcess();
// use in mini program
// import { getSDK } from '@openim/client-sdk';
// const IMSDK = getSDK();
IMSDK.getSubscribeUsersStatus()
.then(({ data }) => {
// data: List of user online status
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
IMSDK.asyncApi('getSubscribeUsersStatus', operationID: string): Promise<UserOnlineState[]>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for problem tracking. It's recommended to use current time combined with a random number. |
Return Results
The function is made Promise-based through the
openim-uniapp-polyfill
package. When calling, usethen
andcatch
to determine and handle success or failure callbacks.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<UserOnlineState[]> | List of user online status |
Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getSubscribeUsersStatus', IMSDK.uuid())
.then((data) => {
// data: List of user online status
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDKRN.getSubscribeUsersStatus(operationID: string): Promise<UserOnlineState[]>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for problem location, keep unique, suggest using current time and random number |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<UserOnlineState[]> | List of user online status |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getSubscribeUsersStatus('operationID')
.then((data) => {
// data: List of user online status
})
.catch(({ errCode, errMsg }) => {
// Call failed
});