SDKsReact Native
Insert local group message
Insert a message directly into local storage for a group chat without sending over the network using the OpenIM React Native SDK.
Write a group message directly into local device database storage:
This method persists the message record only in the local client database without sending it across the network to the server or other group members. It is commonly used for inserting onboarding tips, system alerts, or UI placeholder notices.
const localMessage = await OpenIMSDK.insertGroupMessageToLocalStorage({
message,
groupID,
sendID,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
message | MessageItem | Yes | Complete message object to store locally, typically constructed via message creation methods. |
groupID | string | Yes | Target group ID. |
sendID | string | Yes | Sender user ID, which can be the current user or a virtual system user ID. |
Return value
A resolved Promise returns the MessageItem written to the local database. The message is indexed locally by clientMsgID. To dispatch standard messages over the network to other group members, use Send message.
Was this page helpful?