Querying Messages
To query for a list of all messages in a channel:
This method will return all messages in the specified channel as Flowable<PagedList<AmityMessage>>
or Flowable<PagingData<AmityMessage>>
Stack From End
While the SDK will always return messages in chronological order, developers can ask for the messages to begin from the top of the recyclerview or the bottom of the recyclerview depeding on scrolling direction.
There are other situations where fetching the oldest messages is preferred, for example for archiving purposes or in community forums. (When stack from end is set to false, the list fills its content starting from the top of the view)
Make sure that stackFromEnd
using obtain MessageCollection
is the same as stackFromEnd
of RecyclerView's LayoutManager
. Otherwise it may cause a jumping issue.
Pagination
When querying messages, you cannot set limit
, skip
, after
, first
, before
, and last
parameters. By default, the number of items in each page is 15. To handle pagination to load more messages, refer to Implementing feed pagination.
Last updated