Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app x

Set member friend request permissions

Control whether members can send friend requests to fellow group members.

Copy

The applyMemberFriend property configures whether group members can send friend requests to each other using OpenIMGroupAllowType.

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group identifier.
applyMemberFriendOpenIMGroupAllowTypeYesFriend request permission constant.
Enum constantNumeric valueDescription
OpenIMGroupAllowTypeAllowed0Members are permitted to initiate friend requests from the group roster.
OpenIMGroupAllowTypeNotAllowed1Members are not permitted to initiate friend requests from the group roster.

Code example

import {
  OpenIMGroupAllowTypeNotAllowed,
  setGroupInfo,
} from '@/uni_modules/unix-openim-sdk'

await setGroupInfo({
  groupID,
  applyMemberFriend: OpenIMGroupAllowTypeNotAllowed,
})

Return value

The Promise resolves with void once OpenIMServer updates the permission.

State changes after the call

A resolved Promise confirms that the setting was saved. Update the local group's applyMemberFriend field optimistically, and confirm final state when onGroupInfoChanged arrives matching groupID. This field controls only friendship request initiation within the group; it does not block viewing profiles or affect existing friendships. For complete group event listener registration, see Group overview.