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 send an image message, you must pass a valid local file URL
instance instead. The SDK will resize and process the image object before sending it to the server.
You can also pass an optional caption as part of the message. This caption will be accessible under the data
property in the message model, under the caption
key. You can add up to 1,000 characters of text caption per message.
Use the
fullImage
parameter to request to upload the image at its original resolution. Note that this can drastically reduce the speed of message sending, depending on the original image size. If thefullImage
is set tofalse
, then the uploaded image size will be up to 1500x1500 pixels.
Last updated