Best Practices for handling dynamic data in custom messages (e.g. polls) #2549
-
Hello! I recently began working with the Stream Chat iOS SwiftUI SDK, and I must say, it's fantastic—great job! I have a general question regarding the handling of dynamic data and custom messages. I aim to create polls as custom messages, allowing users to vote and view real-time results. My initial strategy involves creating a custom attachment type with the following structure:
However, I'm unsure about the best practice for storing votes and other dynamic data (e.g., an editable Is my understanding correct, or would you recommend a different approach? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ondrejkorol, Thanks for the kind words, we're glad that you like our SDK! About your question: the approach you suggested makes sense, since now we only support editing the message's extra data. We also plan to allow editing attachments in the future (most likely in Q2), but I think the current state also fits your use-case, so you can get started with it. We are also looking into exposing our own polls component, but that will most likely come end of Q2/start of Q3. Let us know how your implementation goes and if you have any other questions. |
Beta Was this translation helpful? Give feedback.
Hi @ondrejkorol,
Thanks for the kind words, we're glad that you like our SDK!
About your question: the approach you suggested makes sense, since now we only support editing the message's extra data. We also plan to allow editing attachments in the future (most likely in Q2), but I think the current state also fits your use-case, so you can get started with it.
We are also looking into exposing our own polls component, but that will most likely come end of Q2/start of Q3. Let us know how your implementation goes and if you have any other questions.