ViewModel updates and manages APIs used in the fragment. It communicates with Sendbird Chat SDK to receive necessary data. If you wish to customize these data and implement new APIs, you can do so through the
ChannelFragmentis used as an example in the codes below to show how to customize it but you can replace it with any other
- You can add or override new methods by inheriting
- Create a custom
ViewModelby overriding the
onCreateViewModel()method of the custom fragment.
You can use the newly customized
ViewModel by calling the
getViewModel() method of the custom fragment.