Skip to main content

inviteUserToGroup

Function Introduction

Description

Invite users to the group.

Note

The result of the invitation to join the group is determined by the caller's identity and the group verification option.

Related Callbacks: onJoinedGroupAdded onGroupMemberAdded onGroupApplicationAdded

Function Prototype


- (void)inviteUserToGroup:(NSString *)groupID
reason:(NSString *)reason
usersID:(NSArray <NSString *> *)usersID
onSuccess:(nullable OIMSimpleResultsCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

Parameter NameParameter TypeRequiredDescription
groupIDNSStringYesGroup ID
reasonNSStringYesInvitation message
usersIDNSArray <NSString *>YesList of userIDs to be invited

Return Result

Parameter NameParameter TypeDescription
onSuccessNSArray<OIMSimpleResultInfo * >Success return
onFailureOIMFailureCallbackFailure return

OIMSimpleResultInfo

Field NameField TypeDescription
userIDNSStringUser ID
resultNSIntegerInvitation result

Code Example


[OIMManager.manager inviteUserToGroup:@""
reason:@""
usersID:@[]
onSuccess:^(NSArray<OIMSimpleResultInfo *> * _Nullable results) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];