October 25, 2024
Chicago 12, Melborne City, USA
Android

Unexpected Behavior When Fetching Chat Summary with Mesibo SDK in Kotlin


I’m developing a chat list screen for my messenger app using the Mesibo SDK with Kotlin, but I’m encountering some confusing behaviour, and the limited documentation isn’t helping much. Specifically:

  1. Issue with read receipts: Despite setting
    enableReadReceipt = false, whenever I refresh or refetch the chat
    list data, messages are automatically marked as read, and the unread
    count resets to zero. I haven’t called any methods like markRead or
    sendReadReceipt in my code, so I’m unsure why this is happening.
private fun initMesibo() {
    Mesibo.addListener(this)
    Mesibo.setAccessToken(PreferencesManager.getConfig().token)
    Mesibo.setDatabase(Config.DEFAULT_DB_NAME)
    MesiboDateTime.setDefaultDateFormat(true)
    MesiboDateTime.setDefaultRelativeDateText("Today", "Yesterday")
    Mesibo.start()


    val readSummarySession = MesiboReadSession.createReadSummarySession(this)
    readSummarySession.apply {
        enableReadReceipt(false)
        enableChatList(true)
        enableMessages(true)

        // Read and sync data
        val result = read(readCount)
        if (result < readCount) {
            sync(readCount - result, this)
     }
  }
}

If I remove the sync() line, chat retrieval fails entirely. The Mesibo documentation offers minimal information about these methods, so much of the implementation relies on assumptions or trial and error to understand their functionality.

  1. Documentation Challenges: The Mesibo documentation lacks detail, and there aren’t comments in the code, making it difficult to troubleshoot or understand SDK behaviour fully.

  2. No Timestamps for New Group Chats: Group chats without messages or activity lack timestamps, making it challenging to sort them in descending order on the chat screen. the LastSeen value always comes null. What’s the best way to handle ordering in this case?

  3. Offline Chat List Management: How to store this chats summary locally to make it accessible even when the user is offline.

Could anyone provide insights on this behaviour or suggest any workarounds to maintain resolve these issues.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video