Browse SDKs · iOS
Platform
SDKsiOS

Apply to join a group

Apply to join or directly join an OpenIM group on iOS.

Copy

Invoke joinGroup:reqMsg:joinSource:ex:onSuccess:onFailure: to apply to join or directly enter a specified group:

Parameters

ParameterTypeRequiredDescription
groupIDNSString *YesTarget group ID.
reqMsgNSString *NoApplication note message; pass an empty string if not required.
joinSourceOIMJoinTypeYesOrigin method of joining the group, such as OIMJoinTypeSearch.
exNSString *NoCustom extension string; pass nil if not needed.

Code example

[[OIMManager manager] joinGroup:groupID
                         reqMsg:@"Applying to join the discussion group"
                     joinSource:OIMJoinTypeSearch
                             ex:nil
                      onSuccess:^(NSString * _Nullable data) {
                          NSLog(@"joinGroup success");
                      }
                      onFailure:^(NSInteger code, NSString *message) {
                          NSLog(@"joinGroup failed: %ld %@", (long)code, message);
                      }];

Return value

The onSuccess callback returns confirmation when the request is accepted by the server.

State changes after the call

  1. Direct join vs. review flow: If the target group permits direct joining without verification, the user enters the group immediately and receives an onJoinedGroupAdded: event. If the group requires administrator review, onSuccess confirms that the application ticket has been recorded, and the user must await approval.
  2. Event notification: Successful group entries trigger onJoinedGroupAdded:. Application state tracking is documented in Group applications overview.
  3. Re-query calibration: For group listener lifecycle details, refer to Groups overview.