Browse SDKs · Android
SDKsAndroid

Set member friend request permission

Use GroupInfo.applyMemberFriend to control whether users can send friend requests from the group member list.

Copy

applyMemberFriend is an integer switch: 0 disables friend requests and 1 enables them. This rule only affects requests initiated through the member relationship in this group.

GroupInfo update = new GroupInfo();
update.setGroupID(groupID);
update.setApplyMemberFriend(0);

OpenIMClient.getInstance().groupManager.setGroupInfo(update, new OnBase<String>() {
    @Override public void onSuccess(String data) { /* The request completed. */ }
    @Override public void onError(int code, String error) { /* code and error describe the failure. */ }
});

A successful callback means that the permission update request completed; it does not mean that every client has updated its UI. onGroupInfoChanged provides the updated GroupInfo. Merge this permission by groupID. See Group overview for the complete listener setup.