
If we're in a message thread, it'll navigate back to the channel. The handler sends a BackButtonPressed event to the MessageListViewModel, which will decide how to handle this event. Steps 5 and 6: We create a back button handler, and set the same behavior for the MessageListHeaderView and the Activity's OnBackPressedDispatcher.The MessageInputView needs to know when you’re editing a message or when you enter a message thread, which is also a piece of useful information for MessageListHeaderView. Steps 3 and 4: We coordinate the MessageListView with both MessageListHeaderView and MessageInputView.This loose coupling between components makes it easy to customize things, or only use the components you find necessary. Step 2: We bind these ViewModels to their respective Views.MessageInputViewModel - Responsible for composing and sending new messages.


For the filter, we’re specifying all channels of type messaging where the current user is a member. We’re using the default sort option which orders the channels by last_updated_at time, putting the most recently used channels on the top.

In a real-world application, your authentication backend would generate such a token at login / signup and hand it over to the mobile app.

For a production app, we recommend initializing this ChatClient in your Application class. Next, we add the offlinePluginFactory to the ChatClient with withPlugin method for providing offline storage capabilities. This key points to a tutorial environment, but you can sign up for a free Chat trial to get your own later.
