Closed vadimue closed 2 years ago
Hello @vadimue ,
This is documented behavior. Docs here: https://getstream.io/chat/docs/sdk/ios/uikit/controllers/channels/#2-create-a-controller
When you create a ChannelListController
, like so:
let controller = ChatClient.shared.channelListController(query: query)
you need to pass filter
block to it. So the code becomes:
let query = ChannelListQuery(filter: .equal(.cid, to: try! ChannelId(cid: "messaging:Secret-Chat")))
let controller = ChatClient.shared.channelListController(query: query, filter: { $0.cid == ChannelId(type: .messaging, id: "Secret-Chat") })
The client needs to be able to differentiate between channels inserted to Database, so you need to duplicate the filtering logic.
Please let me know if you have further questions!
Thanks a lot for a quick response @b-onc! It was really unobvious to me and my team. The issue is resolved.
What did you do?
I've created two separate ChatChannelListVC with different queries and filters
What did you expect to happen?
I expect a different set of channels independent of each other.
What happened instead?
GetStream Environment
GetStream Chat version: 4.16.0 GetStream Chat frameworks: StreamChat, StreamChatUI iOS version: iOS 15.2 Swift version: Swift 5 Xcode version: Xcode 13.2.1 Device: iPhone 13 Simulator
Additional context
https://user-images.githubusercontent.com/9727361/174053120-a2bc0e6b-9f06-4d46-b2b6-71091275ac9e.mov