Skip to main content

createGroup

Description

info

(1) The creator creates a group as the group owner and specifies the group administrator and ordinary group members. After success, all members enter the group immediately;
(2) It is recommended that the maximum number of group members at a time is 1000, because too many members may cause the data packet to be too large and rejected by the backend.

Note

(1) If groupID is specified, then groupID cannot be repeated;
(2) If groupID is not 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 NameParameter TypeRequiredDescription
groupCreateInfoOIMGroupCreateInfoYesInitialization info during creation

Return Result

Parameter NameParameter TypeDescription
onSuccessOIMGroupInfoSuccess
onFailureOIMFailureCallbackFailure

Code Example


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

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