我在我的应用程序中使用Quickblox,问题是当尝试使用自定义值参数过滤chatdialog消息时,过滤器无效。
聊天documentation
这是mu代码:
ArrayList<QBChatMessage> messages = null;
QBMessageGetBuilder qbMessageGetBuilder = new QBMessageGetBuilder();
qbMessageGetBuilder.eq("bookID", customDialog.getBookID());
qbMessageGetBuilder.sortAsc("date_sent");
try {
messages = QBRestChatService.getDialogMessages(qbChatDialog, qbMessageGetBuilder).perform();
} catch (QBResponseException e) {
e.printStackTrace();
}
响应示例:
{
"skip": 0,
"limit": 100,
"items": [
{
"_id": "58f6c9f4a28f9a0c7f000003",
"attachments": [],
"bookID": "-Kh9UzvClNyHuwNhLcFV",
"chat_dialog_id": "58f6bcdea0eb4766d900003c",
"created_at": "2017-04-19T02:22:44Z",
//other fields
},
{
"_id": "58f6ca12a28f9a08c5000001",
"attachments": [],
"bookID": "-KeA1pw5DGMSTg67Pbp0",
"chat_dialog_id": "58f6bcdea0eb4766d900003c",
"created_at": "2017-04-19T02:23:15Z",
//other fields
}
]
}
[更新] 我使用的是3.3.0版本。
[更新] 22/4/2017 我也尝试了@Jagapathi的回答,我替换了这一行
qbMessageGetBuilder.eq("bookID", customDialog.getBookID());
用这个:
qbMessageGetBuilder.addRule("bookID", QueryRule.EQ, customDialog.getBookID());
但也行不通。