SDKsiOSEnterprise
Retrieve the groups containing a conversation
Retrieve the complete groups containing a conversation with Open_im_sdkGetConversationGroupByConversationID.
Invoke Open_im_sdkGetConversationGroupByConversationID to retrieve the list of conversation groups that contain a specified conversation. A single conversation can belong to multiple groups simultaneously:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | NSString * | Yes | Target conversation ID. |
Code example
#import <OpenIMSDK/CallbackProxy.h>
@import OpenIMCore;
CallbackProxy *callback = [[CallbackProxy alloc]
initWithOnSuccess:^(NSString * _Nullable data) {
[self mergeConversationGroupsJSON:data];
}
onFailure:^(NSInteger code, NSString * _Nullable message) {
NSLog(@"GetConversationGroupByConversationID failed: %ld %@", (long)code, message);
}];
Open_im_sdkGetConversationGroupByConversationID(callback, @"c2c_user1002");Return value
The onSuccess callback delivers a JSON array string in data representing complete group objects containing this conversation (rather than a list of ID strings alone).
State changes after the call
- Snapshot query: This method retrieves an instantaneous membership snapshot and does not trigger asynchronous listener callbacks.
- Event notification: Membership modifications broadcast via
onConversationGroupMemberAdded:andonConversationGroupMemberDeleted:. - Re-query calibration: For listener integration details, refer to Conversation groups overview.
Was this page helpful?