SDKsiOS
Leave a group
Leave a specified OpenIM group on iOS.
Invoke quitGroup:onSuccess:onFailure: to voluntarily leave a specified group:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | NSString * | Yes | Target group ID. Regular members and administrators can exit directly; group owners must transfer ownership first via Transfer group ownership. |
Code example
[[OIMManager manager] quitGroup:groupID
onSuccess:^(NSString * _Nullable data) {
NSLog(@"quitGroup success");
}
onFailure:^(NSInteger code, NSString *message) {
NSLog(@"quitGroup failed: %ld %@", (long)code, message);
}];Return value
The onSuccess callback returns confirmation when the server accepts the group departure.
State changes after the call
- Local state removal: The client removes the group corresponding to
groupIDfrom the locally cached joined group collection. - Event notification: Active client sessions receive notifications through the
onJoinedGroupDeleted:listener callback. - Re-query calibration: For group listener lifecycle details, refer to Groups overview.
Was this page helpful?