Skip to main content

onRecvNewMessages

Feature Introduction

info

This callback is triggered when new messages are received, possibly containing multiple messages.

Return Prototype


onRecvNewMessages(data: WSEvent<MessageItem[]>): void;

Return Results

NameTypeDescription
dataWSEvent<MessageItem[]>New messages

Usage Example

import IMSDK from 'openim-uniapp-polyfill';

IMSDK.subscribe(IMSDK.IMEvents.OnRecvNewMessages, ({ data }) => {
// data is the list of new messages
});