Conversation
|
i have added sending and getting multiple files on chats |
|
Thank you! |
| /// | ||
| /// 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<File> input, List<String> mimeType,List<String> filename) { |
There was a problem hiding this comment.
Hi, thanks for the feature @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 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.
|
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
<#25 (comment)>
:
> @@ -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<File> input, List<String> mimeType,List<String> 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
<#25 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIB3BOJI3RU2T5LMTF6OJULYSW5I5AVCNFSM6AAAAABDAE5YJWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNZRG4ZDANRXGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
|
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. |
No description provided.