Is there anywhere where I can see an example implementation, specifically for onApiResult for the MessageCollection, the rest I can try and implement through trial and error I suppose.
Do these newer collections (and their event handlers) essentially replace ChannelHandler? In some old sample code (and our current codebase) I see that ChannelHandler is used in both the Channels and Chat screens - can we safely replace these with a ChannelCollection and MessageCollection?
Another question in general for all the event handlers like onMessagesAdded, onChannelsAdded, I assume in the callback the respective messages and channels are only the incoming added channels, and not the entire channels right? So it’s best to work with a sort of channel map and add, update, and remove as necessary.
It’s also unclear to me at which moments we should completely invalidate our cached copies of the channels and or messages (if ever) can I ‘trust’ that Sendbird is storing everything in AsyncStorage correctly?
Furthermore, is it advisable to immediately create a MessageCollection per channel? Or use it only while we are in the chat window for a given channel? I would assume the additional async storage entries wouldn’t cause any performance issues…
Thanks for this. I’ve slowly converted everything in our app to the new local storage method, the only thing remaining I mentioned is having trouble with simultaneously storing all messages in the redux store, but it appears to be stored at the local storage (sendbird’s implementation), that chats are retrieved per channel just fine.