Total unreadmessage count quickblox

江枫思渺然 提交于 2019-12-10 17:43:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!