Closed paulz closed 1 year ago
Hi @paulz,
I assume you are doing this with the REST API, right? Since we only have support for giphy attachments via commands in the UI SDKs.
In any case, I see that the type is image
in the sample code above. Can you try with giphy
maybe?
If that doesn't work, then you can pass extra data in the message to identify it as a gif, and update the message resolving logic to use custom attachments for displaying GIFs created from the outside: https://getstream.io/chat/docs/sdk/ios/swiftui/message-components/attachments/#handling-custom-attachments. In this case, you can still use our GiphyAttachmentView
I believe.
Hope that helps, Martin
thank you @martinmitrevski
we were hoping to make this work without changing the client, so both web and swiftui clients can receive gifs we send from server. wondering how users receive each others gifs?
if user A sends /giphy fun
to user B in chat
we hope user B can see the animation
we want on the server construct the same message format that use B receives from user A
that should work theoretically. I assume what happens is that the attachment is resolved as an image attachment, and not as a giphy. Maybe you can put a breakpoint in the giphy payload here: https://github.com/GetStream/stream-chat-swift/blob/develop/Sources/StreamChat/Models/Attachments/ChatMessageGiphyAttachment.swift and check why it's not resolved as a giphy attachmment?
@paulz any updates on this one?
We tried the suggestion but couldn't get it work. So giving up on animated gifs from server for now. Can we convert this to a feature request? Lower priority. Thank you!
yes, I've created a feature request ticket internally. Can't promise anything about when we can deliver this. Closing this ticket for now.
What did you do?
attached an animated GIF
What did you expect to happen?
GIF attachment is animated in the chat channel
What happened instead?
Only first frame displayed as a static image
GetStream Environment
GetStream Chat version: 4.3.0 GetStream Chat frameworks: StreamChat, StreamChatSwiftUI iOS version: 16.0 Swift version: 5 Xcode version: 14.2 Device: iPhone
Additional context