Created
January 31, 2021 19:21
-
-
Save wajahatkarim3/db51a8588a6e9f089c2794e5009ec1ae to your computer and use it in GitHub Desktop.
Loading conversations list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun setLoggedInUI() { | |
if (CometChat.getLoggedInUser() != null) { | |
var conversationsRequest = ConversationsRequest.ConversationsRequestBuilder() | |
.setLimit(50) | |
.setConversationType(CometChatConstants.CONVERSATION_TYPE_USER) | |
.build() | |
conversationsRequest.fetchNext(object : | |
CometChat.CallbackListener<List<Conversation>>() { | |
override fun onSuccess(conversations: List<Conversation>?) { | |
bi.cometchatConversationList.setConversationList(conversations) | |
} | |
override fun onError(ex: CometChatException?) { | |
Snackbar.make( | |
bi.root, | |
ex?.localizedMessage ?: "Couldn't load conversations list", | |
Snackbar.LENGTH_SHORT | |
).show() | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment