Diversido / flutter_twilio_conversations

Integrate the Twilio Conversations SDK with your Flutter app using this Twilio Conversations Flutter plugin
7 stars 7 forks source link

Multiplefiles #25

Open manandharsudhir opened 9 months ago

manandharsudhir commented 9 months ago

i have added sending and getting multiple files on chats

asmodeoux commented 9 months ago

Thank you! @martintrollip @Brandon-Wolff can you guys test these changes please?

manandharsudhir commented 8 months ago

Hello,

I understand your concern about maintaining consistency in method parameters, but I still believe that keeping the parameters the same might not be the best approach. The reason is that in scenarios where multiple images are involved, the filenames can vary significantly. When users view these files, they might rely on the filenames to identify and differentiate between them.

Also I have created another new pull request where android has also been implemented but there is on exception that the user can only add 3 files at once in a single conversation.

Regards, Sudhir Manandhar

On Fri, Feb 9, 2024 at 12:00 PM Martin Trollip @.***> wrote:

@.**** commented on this pull request.

In lib/src/message_options.dart https://github.com/Diversido/flutter_twilio_conversations/pull/25#discussion_r1483901375 :

@@ -35,18 +35,19 @@ class MessageOptions { /// Create message with given media stream. /// /// If you specify [MessageOptions.withMedia] then you will not be able to specify [MessageOptions.withBody] because they are mutually exclusive message types. Created message type will be [MessageType.MEDIA].

  • void withMedia(File input, String mimeType) {
  • void withMedia(List input, List mimeType,List filename) {

Hi, thanks for the feature @manandharsudhir https://github.com/manandharsudhir,

This line will cause a breaking change since the parameters changed to lists. This is evident when compiling the project example. Is there a way to keep the method paramaters the same and chain addMedia calls? See how this builder https://www.twilio.com/docs/conversations/sending-messages-and-media#using-message-builder from the Twilio docs adds multiple files.

In addition, the filename used to be optional. This might be another bug since it's not used on Kotlin and on Swift it's hardcoded to image.jpg. Is it possible to keep it optional and apply defaults if it was not provided?

And finally, this feature has to be applied on the Android plugin as well so that both platforms have the same implementation.

— Reply to this email directly, view it on GitHub https://github.com/Diversido/flutter_twilio_conversations/pull/25#pullrequestreview-1871720675, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIB3BOJI3RU2T5LMTF6OJULYSW5I5AVCNFSM6AAAAABDAE5YJWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNZRG4ZDANRXGU . You are receiving this because you were mentioned.Message ID: @.*** com>

martintrollip commented 8 months ago

It might be best to create new functions taking list parameters then. The change as it is currently stands would break existing usages of the package.