Uttam Byragoni Uttam Byragoni - 20 days ago 12
Android Question

How do we retrieve all messages for a dialog without marking them as read in Android QuickBlox SDK?

I am using QuickBlox Android SDK.

While fetching all messages for a dialog, I do not want to mark messages as read. I tried this way but it is not working.

QBRequestGetBuilder customObjectRequestBuilder = new QBRequestGetBuilder();
HashMap<String,Object> map = new HashMap<>();
map.put("mark_as_read",1);
customObjectRequestBuilder.fillParametersMap(map);
ArrayList<QBChatMessage> messages = QBChatService.getDialogMessages(dialog, customObjectRequestBuilder, new Bundle());


Is there any way to achieve this? Or am I missing something?

Answer

The correct way to manage this way:

QBRequestGetBuilder customObjectRequestBuilder = new QBRequestGetBuilder();
customObjectRequestBuilder.addRule("mark_as_read", "", 0);

another parameters

ArrayList<QBChatMessage> messages = QBChatService.getDialogMessages(dialog, customObjectRequestBuilder, new Bundle());
Comments