Open kornha opened 5 years ago
The code is unclear, and incorrect - I think what would make this much more approachable would be to rename the ChannelManager.sharedManager.channels as ChannelManager.sharedManager.channelDescriptors, to make the distinction between the TCHChannel and the TCHChannelDescriptor much more clear in the code.
Thank you for your reply.
I can make the distinction between the TCHChannel and TCHDescriptor set. However, in my (and my guess, most any) 'MenuTableView' cells, we need to fetch the most recent message to display on the cell. Furthermore, when deleting a channel from the Table, we will delete the TCHChannel, not the descriptor. Which means that, in a general use case we must fetch the TCHChannel. However, we cannot fetch the channels directly from the channelsList. Therefore, each time we fetch channels we must make 2 hops, which is unnecessary latency and slows down our app.
This is my assumption and I would love to be corrected so I can correct my approach.
Hello @kwhinnery I am facing a issue In chat implementation. My code is working properly but when i am sending message or receiving message the delegate method
func chatClient(_ client: TwilioChatClient, channel: TCHChannel, messageAdded message: TCHMessage) {
}
called two times (Except this all delegate method called once) Can you let me know the reason for this Why its happening Please Let me know if you have any idea about this issue
Thanks
@devlove1C - can you open another issue for this, and include some more code from your application that shows how you set the delegate?
Hello,
I have followed the code closely and noticed what appears to me to be a problem, but I could be wrong and would love to be shown why. Specifically, in ChannelManager.swift
Adds a list of TCHChannelDescriptor to self.channels. However, if on this same list in MenuViewController.swift the following casts get called:
Furthermore, in ChannelManager.swift the following is called:
This will also NOT work if the channel in channels is of type TCHChannelDescriptor (which it will be if it is added from populateChannels())
I certainly hope I am missing something and this is not an enormous code oversight, so please let me know what I missed.
Thank you tons.