问题
Hello how to get the total number of unread messages in quicblox? For all dialogs. Is there any direct api call? Thanks!
回答1:
Please find the ways of counting unread messages in the SDK Chat Samples. For example, iOS: http://quickblox.com/developers/SimpleSample-chat_users-ios
回答2:
Here is Working code to fetch total unread-message count from quickblox (Swift)
let dialogsIDs: NSSet = NSSet(array: [])
QBRequest.totalUnreadMessageCountForDialogs(withIDs: dialogsIDs as! Set<String>, successBlock: { (response, count, dialogs) in
print(count) // Your unread-message count is here.
}) { (response) in
print(response.error as Any)
}
If you want to fetch the unread count for particular dialogID then simply pass the dialogsIDs in array like this :
let dialogsIDs: NSSet = NSSet(array: ["5c500568a0eb470421271794","5c523447a28f9a3ac1f2c1ca"])
来源:https://stackoverflow.com/questions/31363593/total-unreadmessage-count-quickblox