Set group member friend permission
Control whether group members can send friend requests to each other using the OpenIM Flutter SDK.
Configure whether regular group members are permitted to send friend requests to one another through group chat interactions or member rosters:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | String | Yes | Target group ID. |
applyMemberFriend | int | Yes | Whether group members may add each other as friends. |
Code example
await OpenIM.iMManager.groupManager.setGroupInfo(
GroupInfo(
groupID: groupID,
applyMemberFriend: AllowType.notAllow,
),
);AllowType enum options:
| Enum Option | Value | Behavior |
|---|---|---|
AllowType.allow | 0 | Members may send friend requests to fellow group members. |
AllowType.notAllow | 1 | Members are restricted from sending friend requests through the group. |
This setting restricts friend applications; it does not control member profile visibility. To manage profile card access, see Set group member profile access.
Return value
A successful Future indicates that the friend request permission has been updated on the server.
State changes after the call
The server broadcasts group profile update notifications. The client updates applyMemberFriend on the local group record using groupID as the key. For complete listener integration, see Groups overview. To recalibrate group state, call Get specified groups info.
Was this page helpful?