SDKsuni-app / uni-app x
Set member friend request permissions
Control whether members can send friend requests to fellow group members.
The applyMemberFriend property configures whether group members can send friend requests to each other using OpenIMGroupAllowType.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group identifier. |
applyMemberFriend | OpenIMGroupAllowType | Yes | Friend request permission constant. |
| Enum constant | Numeric value | Description |
|---|---|---|
OpenIMGroupAllowTypeAllowed | 0 | Members are permitted to initiate friend requests from the group roster. |
OpenIMGroupAllowTypeNotAllowed | 1 | Members 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.
Was this page helpful?