onRecvOfflineNewMessage
Feature Introduction
info
When the application is running in the background and a new message is received, this callback is triggered. The callback will carry only one message.
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- Unity
Return Prototype
void recvOfflineNewMessage(Message msg)
Return Result
Name | Type | Description |
---|---|---|
msg | Message | New Offline Message |
Return Prototype
void onRecvOfflineNewMessage(List<Message> msg)
Return Result
Name | Type | Description |
---|---|---|
msg | List<Message> | New Offline Messages |
Return Prototype
onRecvOfflineNewMessage(data: WSEvent<MessageItem>): void;
Return Result
Name | Type | Description |
---|---|---|
data | WSEvent<MessageItem> | New Offline Message |
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.OnRecvOfflineNewMessage, ({ data }) => {
// data is the new offline message
});
Return Prototype
onRecvOfflineNewMessage(data: WSEvent<MessageItem>): void;
Return Result
Name | Type | Description |
---|---|---|
data | WSEvent<MessageItem> | New Offline Message |
Example Call
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.subscribe(IMSDK.IMEvents.OnRecvOfflineNewMessage, ({ data }) => {
// data is the new offline message
});