SDKsiOSEnterprise
Update a conversation group
Update a conversation group with Open_im_sdkUpdateConversationGroup.
Invoke Open_im_sdkUpdateConversationGroup to modify the name, custom extension string, or visibility status of an existing conversation group:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationGroupID | NSString * | Yes | Target conversation group ID. |
name | NSString * | No | New conversation group name. |
ex | NSString * | No | New custom extension string. |
hidden | NSNumber * | No | Whether to hide this group in navigation interfaces (wrapped BOOL). |
Code example
#import <OpenIMSDK/CallbackProxy.h>
@import OpenIMCore;
NSDictionary *request = @{
@"conversationGroupID": @"group_work_101",
@"name": @"Priority Work",
@"hidden": @NO,
};
NSData *requestData = [NSJSONSerialization dataWithJSONObject:request options:0 error:nil];
NSString *requestJSON = [[NSString alloc] initWithData:requestData
encoding:NSUTF8StringEncoding];
CallbackProxy *callback = [[CallbackProxy alloc]
initWithOnSuccess:^(NSString * _Nullable data) {
if (data == nil) {
return;
}
[self upsertConversationGroupJSON:data];
}
onFailure:^(NSInteger code, NSString * _Nullable message) {
NSLog(@"UpdateConversationGroup failed: %ld %@", (long)code, message);
}];
Open_im_sdkUpdateConversationGroup(callback, requestJSON);Return value
The onSuccess callback delivers the updated group JSON string in data. The client updates the local cache using conversationGroupID as the unique identifier.
State changes after the call
- Local state update: The client updates local group properties corresponding to
conversationGroupID. - Event notification: Synchronized updates across devices broadcast via the
onConversationGroupChanged:listener callback. - Re-query calibration: For listener registration and event handling details, refer to Conversation groups overview.
Was this page helpful?