Add conversations to groups
Add conversation-group relationships with Open_im_sdkAddConversationsToGroups.
Use Open_im_sdkAddConversationsToGroups to add one or more conversations to one or more conversation groups. It only creates relationships; it does not create conversations or change message targets.
NSData *conversationData =
[NSJSONSerialization dataWithJSONObject:@[conversationID] options:0 error:nil];
NSString *conversationIDsJSON =
[[NSString alloc] initWithData:conversationData encoding:NSUTF8StringEncoding];
NSData *groupData =
[NSJSONSerialization dataWithJSONObject:@[conversationGroupID] options:0 error:nil];
NSString *groupIDsJSON =
[[NSString alloc] initWithData:groupData encoding:NSUTF8StringEncoding];Pass your callback, conversationIDsJSON, and groupIDsJSON to Open_im_sdkAddConversationsToGroups. Both JSON arrays are required, and the conversation array must not be empty.
Result
A successful callback means that the relationship request has completed. It does not return updated group objects or mean that the listener has arrived on every client.
The related incremental update is onConversationGroupMemberAdded:. For the complete handler, see Conversation groups overview.
Was this page helpful?