loadMessages

suspend fun loadMessages(    context: Context,     conversationId: Int?,     timeout: Long = 10000): ApiResult<Boolean>

Call this method to load messages of the given conversation.

This method should be called only from a coroutine or another suspend function

This method will try to load the oldest messages for the given conversation.

The maximum number of the message to retrieve foreach conversation is configured by the backend and has a default value can be configured manually using the configuration XML file (integer attribute key : maximum_messages_to_retrieve_default_value).

This method should be executed in a worker thread since it contains a lot of operation that can exceed 5sec or block the UI thread.

Return

ApiResult This is the callback that will be invoked to handle operation result:

    Success : the load messages request is successfully sent to the server.
    Error : a local error occurred when trying to send this request to the server

Possible errors : MessagingError.ErrorCode.NO_MORE_MESSAGE_TO_LOADMessagingError.ErrorCode.CONVERSATION_NOT_FOUND

Parameters

context

The application context

conversationId

The identifier of the conversation