/ SDKs / Android
SDKs
Chat SDKs Android v4
Chat SDKs Android
Chat SDKs
Android
Version 4

Retrieve a list of members and operators in a specific order

Copy link

The members and operators of a group channel can be retrieved by calling the next() method of a MemberListQuery instance.

MemberListQueryParams.Order

Copy link

For a specific order, set one of the values in the following table to the order property of MemberListQueryParams.

ValueDescription

MEMBER_NICKNAME_ALPHABETICAL

Members are arranged in an alphabetical order. This is the default value.

OPERATOR_THEN_MEMBER_ALPHABETICAL

Operators are listed first, then the members, both in an alphabetical order.

val query = groupChannel.createMemberListQuery(
    MemberListQueryParams().apply {
        limit = 10
        order = MemberListQuery.Order.OPERATOR_THEN_MEMBER_ALPHABETICAL
    }
)
query.next { members, e ->
    if (e != null) {
        // Handle error.
    }

    // A list of matching members and operators is successfully retrieved.
    // Through the members parameter of the callback method,
    // you can access the data of each item from the result list that the Sendbird server has passed to the callback method.
}

MemberListQueryParams.OperatorFilter

Copy link

For a specific order, set one of the values in the following table to the operatorFilter property of MemberListQueryParams.

ValueDescription

all

No filter is applied to the group channel list. This is the default value.

operator

Only operators are retrieved in the list.

nonOperator

All members, except for operators, are retrieved in the list.

val query = groupChannel.createMemberListQuery(
    MemberListQueryParams().apply {
        limit = 10
        operatorFilter = OperatorFilter.OPERATOR // ALL, OPERATOR, and NONOPERATOR
    }
)
query.next { members, e ->
    if (e != null) {
        // Handle error.
    }

    // A list of matching members and operators is successfully retrieved.
    // Through the members parameter of the callback method,
    // you can access the data of each item from the result list that the Sendbird server has passed to the callback method.
}