onRecvOfflineNewMessages
Feature Introduction
info
When the application is running in the background and receives new messages, this callback is triggered. The callback might carry multiple messages.
- uni-app
- Browser/Electron/MiniProgram
Return Prototype
Return Prototype
Parameter Explanation
Return Prototype
onRecvOfflineNewMessages(data: WSEvent<MessageItem[]>): void;
Return Result
Name | Type | Description |
---|---|---|
data | WSEvent<MessageItem[]> | New Messages |
Example Call
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.OnRecvOfflineNewMessages, ({ data }) => {
// data is the list of new offline messages
});
Return Prototype
onRecvOfflineNewMessages(data: WSEvent<MessageItem[]>): void;
Return Result
Name | Type | Description |
---|---|---|
data | WSEvent<MessageItem[]> | New Messages |
Example Call
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.subscribe(IMSDK.IMEvents.OnRecvOfflineNewMessages, ({ data }) => {
// data is the list of new offline messages
});