Skip to main content

createGroup

Feature Introduction

Description
  1. The creator establishes a group as the group owner, specifying group administrators and ordinary group members. Once successful, all roles immediately join the group.
  2. It's recommended that the number of group members does not exceed 1000 at a time, as larger numbers may result in data packets being rejected by the backend due to their size.
Note
  1. If a groupID is specified, it cannot be duplicated.
  2. If no groupID is specified, the server will generate a unique groupID.

Related Callbacks: onJoinedGroupAdded onGroupMemberAdded

Function Prototype


- (void)createGroup:(OIMGroupCreateInfo *)groupCreateInfo
onSuccess:(nullable OIMGroupInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

Parameter NameData TypeRequiredDescription
groupCreateInfoOIMGroupCreateInfoYesInitialization information for creating a group

Return Value

Parameter NameData TypeDescription
onSuccessOIMGroupInfoSuccessful return
onFailureOIMFailureCallbackFailure return

Example Code


OIMGroupCreateInfo *group = [OIMGroupCreateInfo new];
group.groupName = @"";
group.introduction = @"";

[OIMManager.manager createGroup:group
onSuccess:^(OIMGroupInfo * _Nullable groupInfo) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];