Browse SDKs · iOS
Platform
SDKsiOS

Accept a group application

Accept an iOS group application.

Copy

Invoke acceptGroupApplication:fromUserId:handleMsg:onSuccess:onFailure: to approve a specified group application (restricted to group owners and administrators):

Parameters

ParameterTypeRequiredDescription
groupIDNSString *YesTarget group ID.
fromUserIdNSString *YesUser ID of the applicant.
handleMsgNSString *NoApproval remark or message.

Code example

[[OIMManager manager] acceptGroupApplication:@"group_1001"
                                  fromUserId:@"user_003"
                                   handleMsg:@"Approved to join the project team"
                                   onSuccess:^(NSString * _Nullable data) {
                                       NSLog(@"acceptGroupApplication success");
                                   }
                                   onFailure:^(NSInteger code, NSString *message) {
                                       NSLog(@"acceptGroupApplication failed: %ld %@", (long)code, message);
                                   }];

Return value

The onSuccess callback returns confirmation when the server accepts the approval.

State changes after the call

  1. Application status update: The application status change broadcasts via the onGroupApplicationAccepted: listener callback. The client matches records by groupID:userID and updates the entry status to approved.
  2. Member addition: Once the applicant successfully enters the group, the onGroupMemberAdded: event is broadcast. The client adds the user into the local member cache matching groupID:userID.
  3. Re-query calibration: For listener integration and list management, refer to Group applications overview and Group member queries overview.