SDKsiOSEnterprise
Set conversation-group order
Set the order of multiple conversation groups with Open_im_sdkSetConversationGroupOrder.
Invoke Open_im_sdkSetConversationGroupOrder to update display ordering indexes for multiple conversation groups in a batch:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationGroupID | NSString * | Yes | Target conversation group ID within each order entry. |
order | NSNumber * | Yes | New numeric ordering index. |
Code example
#import <OpenIMSDK/CallbackProxy.h>
@import OpenIMCore;
NSArray *orders = @[
@{ @"conversationGroupID": @"group_work_101", @"order": @100 },
@{ @"conversationGroupID": @"group_life_102", @"order": @200 },
];
NSData *requestData = [NSJSONSerialization dataWithJSONObject:orders options:0 error:nil];
NSString *requestJSON = [[NSString alloc] initWithData:requestData
encoding:NSUTF8StringEncoding];
CallbackProxy *callback = [[CallbackProxy alloc]
initWithOnSuccess:^(NSString * _Nullable data) {
NSLog(@"SetConversationGroupOrder success");
}
onFailure:^(NSInteger code, NSString * _Nullable message) {
NSLog(@"SetConversationGroupOrder failed: %ld %@", (long)code, message);
}];
Open_im_sdkSetConversationGroupOrder(callback, requestJSON);Return value
The onSuccess callback returns confirmation when the ordering request is completed.
State changes after the call
- Local state update: The client updates the
orderproperty for matching groups keyed byconversationGroupIDand re-sorts the group list. - Event notification: Group property changes broadcast via the
onConversationGroupChanged:listener callback across client sessions. - Re-query calibration: For listener integration details, refer to Conversation groups overview.
Was this page helpful?