Skip to content
v1
文档/Android SDK/会话

最近会话与会话查询

kotlin
suspend fun getRecentConversationList(limit: Int): List<BimConversation>
suspend fun getConversationByUserId(userId: String): BimConversation?
suspend fun getConversationByGroupId(groupId: String): BimConversation?
suspend fun getAllUnreadMessageCount(): Int
kotlin
val service = BimImManager.getInstance().conversationService
val recent = service.getRecentConversationList(limit = 20)
val privateChat = service.getConversationByUserId("u10002")
val groupChat = service.getConversationByGroupId("d10001")
val unread = service.getAllUnreadMessageCount()

返回值来自当前登录账号的数据域;账号切换后不要复用之前缓存的对象。