searchMessages

suspend fun searchMessages(    context: Context,     query: String? = null,     contactQuery: String? = null,     mediaFilter: MediaFilter = MediaFilter.None,     ascOrder: Boolean = false,     @IntRange(from = 0) limit: Int = 100): List<MessageSearchResult>?

This function retrieves conversations according to the query, contactQuery&mediaFilter based on :

  • message content or attachment file name

  • sender number (or his contact name) of the message sent

  • member in a OneToOne conversation

  • attachment types matches the mediaFilter

Return

A Flow of MessageSearchResult.

See also

Parameters

context

The application context

query

A search query. Doesn't need any special formatted -- it'll be sanitized.

contactQuery

An exact query text related to the recipient name or his number.

mediaFilter

A filter that will be applied in the search query

ascOrder

Whether the result is ordered ascending or descending according to the date

limit

The max number of messages record to be retrieved, 0 will return all possible records. Value should be >= 1. default is 100