Filter messages to different types (eg. file, custom, etc)

We’d like to potentially show all media messages (eg. documents, photos, video, etc) in its own view. Is it possible to filter messages to only return file messages or custom messages?

I’ve tried setting the SBDMessageListParams.messageType == .file, but that doesn’t appear to work.

Hello @seths would you share some code snippet that you implied? and how doesnt it work?

In ChannelCustomManager, in messageParamsCustom(), I have:

let params = SBDMessageListParams()
params.messageType = SBDMessageTypeFilter.file // filter to only "file" messages
let channelVC = ChannelVC_MessageParam(channel: channel, messageListParams: params)

I would expect that setting the messageType to File would only deliver file-based messages, but it returns everything. If I set a customType on a message and filter by that, it does work; it doesn’t appear to work with messageType though.

What SDK version are you using? Would you please be specific about which method you used, because we do not have ChannelVC_MessageParam in sdk. I just tested with getMessagesByTimestamp:params:completionHandler: and set params as you did and it worked.

Thanks. Right now I’m modifying the sample project here: GitHub - sendbird/sendbird-uikit-ios: Sendbird UIKit for iOS is a development kit with a user interface, offering a simplified integration into chat.

I’ll try using the direct method rather than going through the abstraction to see if that works.

If you are using UIKit, you should use methods from UIKit in order to make it work properly. Let me check the sample and get back to you

1 Like

HI @seths,

I checked that the messageType did not work properly inside.
We are going to fix it and distribute a new version.
When the fixed version is distributed, it will work well if you use it the way you implemented it now.
However, the next distribution schedule will take some time.
If it needs to be handled urgently, please let me know.

1 Like

Thanks for the quick follow-up. We can wait for a solution or use a customType workaround.

1 Like