SDKsHarmonyOSEnterprise
Get pinned messages in conversation
Query all currently pinned messages within a conversation.
Retrieves all pinned messages for a specific conversation by conversationID.
Code example
import sdk, { GetConversationPinnedMsgReq, GetConversationPinnedMsgResp } from '@openimsdk/imsdk';
const request: GetConversationPinnedMsgReq = { conversationID: conversationID };
const response: GetConversationPinnedMsgResp = await sdk.getConversationPinnedMsg(request);
replacePinnedMessages(conversationID, response.message);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Target conversation identifier. |
Return value
Returns a Promise resolving to GetConversationPinnedMsgResp:
| Property | Type | Description |
|---|---|---|
message | IMMessage[] | Array of currently pinned messages within the conversation. |
State changes after the call
In the response payload, message is an array of IMMessage objects. When rendering pinned messages, deduplicate by clientMsgID and reconcile against recent deletion, revocation, or edit events. This query does not fire pin change events; for real-time synchronization, see Pin or unpin a message.
Was this page helpful?