I have a chat app which uses the Realtime API for the chats, I am trying to create a file sharing feature for the app using storage. But my question is how to show the photos(let's say) in the app.
Like the photo should remain at the same position where it was sent. How do I achieve this?
Summary
User is asking for help with adding files to their chat app and displaying photos in the chat. They want the photos to persist even after the user refreshes the page. They are wondering how to show the photos in the app and have them remain at the same position where they were sent. They mention creating a new attribute in the message collection to store the image URL and using the previewImage endpoint. Another user suggests checking the documentation for storage and provides a link. The original user confirms they have read the documentation and thanks someone named Steven. The thread ends with someone saying the issue is solved. Solution: Create a new attribute in the message
Drake
Nov 5, 2023, 21:52
Remain at the same position? What do you mean?
SreeSen
Rank 2: Process
Nov 6, 2023, 02:59
I think I overexplained my problem, sorry for that. I just want to send photos to my chat.
Yes I have read the docs, I want the photos to persist in the chat even after the user refreshes the page. One way I can think of is to create a new attribute in the message collection and add the image url to it and then display it in the chat.
Drake
Nov 6, 2023, 03:28
Yes
SreeSen
Rank 2: Process
Nov 6, 2023, 03:37
Thankyou Steven!
SreeSen
Rank 2: Process
Nov 6, 2023, 14:24
Implemented! Used this approach created an attribute in the messages collections named file_id and the used the previewImage endpoint to show it in the chat if the file_id is not null
D5
Moderator
Nov 7, 2023, 20:22
Great!
D5
Moderator
Nov 7, 2023, 20:22
Does that solves the issue?
SreeSen
Rank 2: Process
Nov 10, 2023, 05:47
Ah! Yes it did. Closing this post.
Drake
Nov 10, 2023, 17:52
[SOLVED] Need help with adding files to my chat app