Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app xEnterprise

Reorder conversation groups

Batch update the display sort order indices for multiple conversation groups.

Copy

Reordering conversation groups is a Commercial Edition capability. Batch update group display sequences by supplying an array of group identifiers paired with their corresponding sort order values.

Parameters

ParameterTypeRequiredDescription
conversationGroupOrdersOpenIMConversationGroupOrderItem[]YesArray of group ordering objects.
conversationGroupOrders[].conversationGroupIDstringYesIdentifier of the conversation group to position.
conversationGroupOrders[].ordernumberYesSequence sorting index value.

Code example

import { setConversationGroupOrder } from '@/uni_modules/unix-openim-sdk'

await setConversationGroupOrder({
  conversationGroupOrders: [
    { conversationGroupID: firstGroupID, order: 100 },
    { conversationGroupID: secondGroupID, order: 200 },
  ],
})

The sorting direction (ascending or descending) is established by application UI conventions.

Return value

The Promise resolves with void upon successful completion.

State changes after the call

Promise resolution indicates that the updated order indices were applied. Immediately re-sort your local group tabs using the new order values indexed by conversationGroupID. When group change events arrive, re-query the group list to calibrate order as documented in Conversation group overview.