Chat / Android
Chat Android v4
Chat Android
Chat
Android
Home
/
Chat
/
Android
/
User
This is the new Docs for Chat SDK v4 for Android. To see the previous Docs, click here.

Retrieve a list of members and operators in a specific order

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

MemberListQueryParams.Order

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

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.
}