unsubscribeUsersStatus
Function Introduction
Description
Unsubscribe from the online status of users.
Warning
After unsubscribing, you will no longer be notified of the user's online and offline status.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<UserStatusInfo>> unsubscribeUsersStatus(
List<String> userIDs, {
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
userIDs | List<String> | Yes | List of User IDs |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
then | void | Successful callback |
onError | Function | Error callback |
Code Sample
await OpenIM.iMManager.userManager.unsubscribeUsersStatus([]);
// todo
Function Prototype
- (void)unsubscribeUsersStatus:(NSArray<NSString *> *)userIDs
onSuccess:(nullable OIMUserStatusInfosCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
userIDs | NSArray<NSString *> | Yes | List of User IDs |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Success return |
onFailure | OIMFailureCallback | Error return |
Code Sample
[OIMManager.manager unsubscribeUsersStatus:@[]
onSuccess:^(NSString * _Nullable result) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void unsubscribeOnlineUsersStatus(OnBase<String> callBack, List<String> uid)
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
callback | OnBase<List<UsersOnlineStatus>> | Yes | User ID |
ids | List<String> | Yes | User ID |
Code Sample
OpenIMClient.getInstance().userInfoManager.unsubscribeOnlineUsersStatus(new OnBase<List<UsersOnlineStatus>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<UsersOnlineStatus> data) {
}
},ids);
// todo
Function Prototype
IMSDK.unsubscribeUsersStatus(userIDList: string[], operationID?: string): Promise<WsResponse<UserOnlineState[]>>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
userIDList | string[] | Yes | List of User IDs |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<UserOnlineState[]>> | User online status detail list |
Promise.catch() | Promise<WsResponse> | Error callback |
Code Sample
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 { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.unsubscribeUsersStatus()
.then(({ data }) => {
// data: User online status detail list
})
.catch(({ errCode, errMsg }) => {
// Error handling
});
Function Prototype
IMSDK.asyncApi('unsubscribeUsersStatus', operationID: string, userIDList: string[]): Promise<UserOnlineState[]>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for problem tracking. Keep it unique; it's recommended to use the current time and a random number. |
userIDList | string[] | Yes | List of User IDs |
Return Result
Through the
openim-uniapp-polyfill
package, the function is turned into a Promise. When invoking, you need to usethen
andcatch
to determine and handle successful and failed callbacks.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<UserOnlineState[]> | User online status detail list |
Promise.catch() | Promise<CatchResponse> | Error callback |
Code Sample
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('unsubscribeUsersStatus', IMSDK.uuid())
.then((data) => {
// data: User online status detail list
})
.catch(({ errCode, errMsg }) => {
// Error handling
});
Function Prototype
OpenIMSDKRN.unsubscribeUsersStatus(userIDList: string[], operationID: string): Promise<UserOnlineState[]>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
userIDList | string[] | Yes | User ID list |
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[]> | User online status details list |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.unsubscribeUsersStatus(userIDList, 'operationID');
.then((data) => {
// data: User online status detail list
})
.catch(({ errCode, errMsg }) => {
// Error handling
});