SDKsHarmonyOSEnterprise
Set group member friend permission
Control whether members can send friend requests to each other from within the group.
This setting governs whether group members can initiate friend applications to fellow members through the group interface. It does not hide member profile cards or affect existing friendships:
Code example
import sdk, { GroupApplyMemberFriend, SetGroupInfoReq } from '@openimsdk/imsdk';
const request: SetGroupInfoReq = {
groupID: groupID,
applyMemberFriend: GroupApplyMemberFriend.AllowGroupApplyMemberFriend,
};
await sdk.setGroupInfo(request);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group identifier. |
applyMemberFriend | GroupApplyMemberFriend | Yes | Member friend addition policy enum value. |
| Option | Value | Description |
|---|---|---|
GroupApplyMemberFriend.AllowGroupApplyMemberFriend | 0 | Members may send friend requests to each other from the group. |
GroupApplyMemberFriend.ProhibitGroupApplyMemberFriend | 1 | Members are prohibited from sending friend requests to each other within the group. |
Return value
Returns a Promise that resolves to void upon updating the permission.
State changes after the call
Resolving the Promise updates the policy on the server. The SDK emits EventOnGroupInfoChanged; match the group by groupID and update its applyMemberFriend property in UI state, as detailed in Group overview.
Was this page helpful?