SDKsiOS
Set the group-member extension field
Set an application-defined extension string for a specified group member with OpenIM iOS SDK.
Invoke setGroupMemberInfo:onSuccess:onFailure: with a parameter dictionary containing ex to set custom application-defined extension data for a specified group member:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupMemberInfoDictionary | NSDictionary * | Yes | Dictionary containing member identification and updated extension string. |
Dictionary keys
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | NSString * | Yes | Target group ID. |
userID | NSString * | Yes | Target member user ID. |
ex | NSString * | Yes | Custom extension string (typically formatted as JSON). |
Code example
NSDictionary *updates = @{
@"groupID": @"group_1001",
@"userID": @"user_003",
@"ex": @"{\"level\":5,\"title\":\"Technical Lead\"}"
};
[[OIMManager manager] setGroupMemberInfo:updates
onSuccess:^(NSString * _Nullable data) {
NSLog(@"setGroupMemberInfo ex success");
}
onFailure:^(NSInteger code, NSString *message) {
NSLog(@"setGroupMemberInfo ex failed: %ld %@", (long)code, message);
}];Return value
The onSuccess callback returns confirmation when the server saves the member extension string.
State changes after the call
- Local state update: The client updates the member's
exattribute matchinggroupID:userID. The write operation completely replaces the stored extension string without merging nested keys. - Event notification: Updated member details broadcast across active client sessions through
onGroupMemberInfoChanged:. - Re-query calibration: For member queries, refer to Group member queries overview.
Was this page helpful?