Skip to main content

Image and GIF Messages

Users can send image messages and GIF messages through the built-in image plugin in Global IM UIKit. The messages will appear in the message list component of the chat UI. By default, the SDK sends messages containing the following message content objects:

  • The image message content class is RCImageMessage (type identifier: RC:ImgMsg)
  • The GIF message content class is RCGIFMessage (type identifier: RC:GIFMsg)

(width=220) (width=220)

Limitations

  • Only local images and GIFs are supported.
  • The maximum size for images is 100 MB.
  • The maximum size for GIFs is 2 MB. Files exceeding this limit will be sent as file messages.
  • Files in image messages and GIF messages can only be uploaded to RC servers and cannot be uploaded to custom server addresses.

Usage

The extension panel includes a default entry for sending image messages, implemented by the built-in Photo in Global IM UIKit. Users can click the + button on the right side of the input bar to expand the extension panel, then click the image icon to open the local photo album and select images or GIF files to send.

(width=220)

Customization

Adjusting Image Compression Quality

Before sending, images are compressed in quality and thumbnails are generated for display in the chat UI. GIFs do not have thumbnails and are not compressed.

  • Thumbnails for Image Messages: The SDK generates a large image with 30% of the original quality that meets the standard size requirements before uploading and sending. The compressed image's longest side does not exceed 240 px. The thumbnail is used for display in the chat UI.
  • Images: If the original image is not selected for sending, the SDK generates a large image with 85% of the original quality that meets the standard size requirements before uploading and sending. The compressed image's longest side does not exceed 1080 px.

Generally, it is not recommended to modify the SDK's default compression settings. For instructions on adjusting the SDK's compression quality, refer to the knowledge base document How to Modify the SDK's Default Image and Video Compression Settings.

Hiding the Photo Album Entry in the Extension Panel

[self.inputBar.addExpandItems removeObjectAtIndex:0];