Image Message
Amity will automatically optimize the image and when queried, will return the image in small, medium and large sizes. If the image is marked as isFull
on upload, the original size of the image can also be returned.
Requirements for Images
Supported image types are JPG and PNG.
The maximum file size of the image is 1 GB.
When an image is uploaded, it is automatically resized into multiple sizing options. The size of the image is determined by its longest dimension (in pixels) with the aspect ratios being unchanged.
Sending a message with image
To create an image message, you need to leverage the FileRepository
. Create an image and pass the image ID into the createImageMessage
later on. This method also accepts an optional caption
parameter to be able to display additional text with the message. You can add up to 1,000 characters of text caption per message.
Here's a small example on how to create a message with an image attached. The process is pretty simple:
Upload an image.
Create a message with the uploaded image ID.
Last updated