amazon-chime-sdk-js
amazon-chime-sdk-js copied to clipboard
How to send attachments and emojis in Chime Messaging ?
What are you trying to do?
I am trying to find out how I can send an attachment like a file ( doc/pdf/xml/json/xlsv/odt/txt ) or maybe an image or a video in a conversation channel? So far the messaging has been working fine on basic texting, I am only able to push text messages into the channel using sendChannelMessage
Also, along with media files, does this SDK supports emoticons & emojis ?
What documentation have you looked at so far?
Using backend PHP so have gone through this: https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-chime-2018-05-01.html Read these too : https://docs.aws.amazon.com/chime/latest/dg/configure-attachments.html https://docs.aws.amazon.com/chime/latest/dg/using-the-messaging-sdk.html P.S. Using min.js version of this SDK on frontend for the Messaging observer to capture the meeting events.
Guys any update?
Hi, so sorry for the late response!
Currently we do not support native attachments for messaging sdk. However, we have sample code to achieve it using metadata in SendChannelMessage API and S3 on our demo app.
Please see here for how to upload attachment to S3 and pass the information as json through metadata in our send channel message API: https://github.com/aws-samples/amazon-chime-sdk/blob/main/apps/chat/src/containers/input/Input.jsx#L77-L116.
Please see here for how to get the attachment information from metadata of a channel message: https://github.com/aws-samples/amazon-chime-sdk/blob/main/apps/chat/src/containers/messages/Messages.jsx#L253-L261. Then download it from S3 using the attachment service. https://github.com/aws-samples/amazon-chime-sdk/blob/main/apps/chat/src/containers/messages/Messages.jsx#L294-L298.
Please see here for our attachment service implementation: https://github.com/aws-samples/amazon-chime-sdk/blob/main/apps/chat/src/services/AttachmentService.js. And our S3 bucket template for cloudFormation: https://github.com/aws-samples/amazon-chime-sdk/blob/main/apps/chat/src/backend/serverless/template.yaml#L171-L191.
For emoji, we currently do not support native emoji as well. However you can use other emoji libraries to achieve it, for example the emoji-picker-react library. With emoji libraries, you can send the emoji via a standard channel message using SendChannelMessage API.
Please let us know if you have any other questions. Thanks!
2024 and it looks like the decimation on this workaround has fallen behind the demo page has a notice of deprecation the permalinks to reference the GitHub sources have not merged well with the branch updates. if anyone has up-to-date resources or know what authorization protocol is in place for the chime web service it would be nice to not have a S3 on the side for migration