SDKsiOS
Apply to join a group
Apply to join or directly join an OpenIM group on iOS.
Invoke joinGroup:reqMsg:joinSource:ex:onSuccess:onFailure: to apply to join or directly enter a specified group:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | NSString * | Yes | Target group ID. |
reqMsg | NSString * | No | Application note message; pass an empty string if not required. |
joinSource | OIMJoinType | Yes | Origin method of joining the group, such as OIMJoinTypeSearch. |
ex | NSString * | No | Custom 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
- 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,onSuccessconfirms that the application ticket has been recorded, and the user must await approval. - Event notification: Successful group entries trigger
onJoinedGroupAdded:. Application state tracking is documented in Group applications overview. - Re-query calibration: For group listener lifecycle details, refer to Groups overview.
Was this page helpful?