Search code examples
androidiostwiliotwilio-conversations

Get messages from closed conversation - Twilio Android and iOS SDK


I am using both Android and iOS official twilio conversations SDK. We need to fetch messages from a closed conversation. However, when calling getLastMessages, it returns an empty list for that specific conversations.

When calling the same method from an active conversation, it works properly. I searched on twilio docs to see if there is some rule about this, but none was found.

Is that a bug or a feature? We have access to messages on closed conversations via twilio Android/iOS sdk? I'm asking this, because we need to access closed conversations for history purposes.


Solution

  • I managed to make it work properly. We must wait for the conversation synchronization status to be ALL, so we can obtain all messages and listen properly to new events.

    With active conversations the returned conversation is already with ALL status, so that's the reason why I could get all the messages normally. But with closed conversations it takes some extra time to synchronize completly.