onRecvNewMessages
Feature Introduction
info
This callback is triggered when new messages are received, possibly containing multiple messages.
- uni-app
- Browser/Electron/MiniProgram
Return Prototype
Return Prototype
Parameter Details
Return Prototype
onRecvNewMessages(data: WSEvent<MessageItem[]>): void;
Return Results
Name | Type | Description |
---|---|---|
data | WSEvent<MessageItem[]> | New messages |
Usage Example
import { getSDK, CbEvents } from '@openim/wasm-client-sdk';
// or
// import { getSDK, CbEvents } from '@openim/client-sdk';
// const IMSDK = getSDK();
const IMSDK = getSDK();
IMSDK.on(CbEvents.OnRecvNewMessages, ({ data }) => {
// data is the list of new messages
});
Return Prototype
onRecvNewMessages(data: WSEvent<MessageItem[]>): void;
Return Results
Name | Type | Description |
---|---|---|
data | WSEvent<MessageItem[]> | New messages |
Usage Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.subscribe(IMSDK.IMEvents.OnRecvNewMessages, ({ data }) => {
// data is the list of new messages
});