Browse SDKs · Flutter
Platform
SDKsFlutter

Set group member friend permission

Control whether group members can send friend requests to each other using the OpenIM Flutter SDK.

Copy

Configure whether regular group members are permitted to send friend requests to one another through group chat interactions or member rosters:

Parameters

ParameterTypeRequiredDescription
groupIDStringYesTarget group ID.
applyMemberFriendintYesWhether 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 OptionValueBehavior
AllowType.allow0Members may send friend requests to fellow group members.
AllowType.notAllow1Members 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.