Browse SDKs · WASM
Platform
SDKsWASM

Insert a local group message

Insert a local group-chat message with the WASM SDK.

Copy

Parameters

ParameterTypeRequiredDescription
messageMessageItemYesComplete message object to write to the local database.
groupIDstringYesID of the target group.
sendIDstringYesUser ID of the message sender.
await openimsdk.insertGroupMessageToLocalStorage({
  message,
  groupID,
  sendID: currentUserID,
});

Resolving the Promise stores the message record on the local device only. Local messages are not synchronized across devices by OpenIMServer and do not trigger remote receive events. To deliver messages to group members normally, call Send a message.