onUserStatusChanged
Description
info
Triggered when the online status of subscribed users changes.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- Unity
Return Prototype
Function(UserStatusInfo info)? onUserStatusChanged;
Return Results
| Name | Type | Description |
|---|---|---|
| info | UserStatusInfo | User status info |
Return Prototype
- (void)onUserStatusChanged:(OIMUserStatusInfo *)info;
Return Results
| Name | Type | Description |
|---|---|---|
| info | OIMUserStatusInfo | User status info |
Return Prototype
void onUserStatusChanged(UsersOnlineStatus onlineStatus)
Return Results
| Name | Type | Description |
|---|---|---|
| info | onlineStatus | User profile information |
Return Prototype
enum OnlineState {
Online = 1,
Offline = 0,
}
type UserOnlineState = {
platformID: Platform;
status: OnlineState;
userID: string;
};
onUserStatusChanged(data: WSEvent<UserOnlineState>): void;
Call 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.on(
CbEvents.OnUserStatusChanged,
({ data }) => {}
);
Return Results
| Name | Type | Description |
|---|---|---|
| data | WSEvent | - |
Return Prototype
enum OnlineState {
Online = 1,
Offline = 0,
}
type UserOnlineState = {
platformID: Platform;
status: OnlineState;
userID: string;
};
onUserStatusChanged(data: WSEvent<UserOnlineState>): void;
Return Results
| Name | Type | Description |
|---|---|---|
| data | WSEvent | - |
Call Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.subscribe(
IMSDK.IMEvents.OnUserStatusChanged,
({ data }: WSEvent<UserOnlineState>) => {}
);
Return Prototype
void OnUserStatusChanged(OnlineStatus userOnlineStatus);
Return Results
| Name | Type | Description |
|---|---|---|
| userOnlineStatus | OnlineStatus | User status info |