For a specific order, set one of the options in the following table to the order property of MemberListQueryParams.
Value
Description
nicknameAlphabetical
Members are arranged in an alphabetical order. This is the default value.
operatorThenMemberNicknameAlphabetical
Operators are listed first, then the members, both in an alphabetical order.
class CustomViewController: ViewController {
var channel: GroupChannel?
var query: MemberListQuery?
func createQuery() {
self.query = channel?.createMemberListQuery(paramsBuilder: { params in
// The `params` object is the `MemberListQueryParams` class.
params.limit = 10
params.order = .operatorThenMemberNicknameAlphabetical // In alphabetical order by default.
})
}
func loadNextPage() {
self.query?.loadNextPage { users, error in
guard error == nil else {
// Handle error.
return
}
// A list of matching members and operators is successfully retrieved.
// Through the users 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.
}
}
}
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.
class CustomViewController: ViewController {
var channel: GroupChannel?
var query: MemberListQuery?
func createQuery() {
self.query = channel?.createMemberListQuery { params in
// The `params` object is the `MemberListQueryParams` class.
params.limit = LIMIT
params.operatorFilter = OPERATOR_FILTER
}
}
func loadNextPage() {
self.query?.loadNextPage { users, error in
guard error == nil else {
// Handle error.
return
}
// A list of matching members and operators is successfully retrieved.
// Through the users 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.
}
}
}