Retrieve chat history of room/group in android

I am using the Smack 4.3.4 android library. The issue is I am fetching the chat history of a particular group using the below code. But its return 0 However, There are many messages which I can see using another client web.

private fun initGroupChatRoom(){
        val mucEnterConfiguration = multiUserChat?.getEnterConfigurationBuilder(nickname)!!
            .requestNoHistory()
            .build()

        try {
            if (!multiUserChat!!.isJoined) {
                multiUserChat?.join(mucEnterConfiguration)
            }
        }catch (e: Exception){
            Log.e("GrpChatAct","Join Error: "+e.toString())
        }

        multiUserChat?.addMessageListener(incomingMessageListener)
    }

private fun chatHistory(){
        CoroutineScope(Dispatchers.IO).launch {
            var mamManager = MamManager.getInstanceFor(multiUserChat)

            var result =  async {
                mamManager.enableMamForAllMessages()
                mamManager.queryMostRecentPage(jId, 70)
            }.await()
         Log.e("GrpChatAct","Total Messages: "+result.messageCount)
      }
 }

Here, I am getting result 0.
Kindly help with this.

I solved using latest library version 4.4.0.beta01

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.