File Message
Users can send file messages through the built-in file plugin in Global IM UIKit. The message will appear in the message list component of the chat UI. The file plugin sends a message by default that contains the file message content object RCFileMessage (type identifier: RC:FileMsg
).
Limitations
- Only supports sending files selected from the system.
- The maximum file size is 100 MB.
- Files in file messages can only be uploaded to RC's servers and cannot be uploaded to custom server addresses.
- Some files, such as txt and pdf, can be previewed in Global IM UIKit, while all files can be opened with other applications.
Sending File Messages
Click the +
button in the input box of the chat UI, and the expand panel will show the option to send file messages.
Customizing the UI of File Messages
File messages are displayed in the message list using RCFileMessageCell
. If you need to adjust the built-in message style, it is recommended to customize the message cell and provide this custom cell to the SDK. All message templates in Global IM UIKit inherit from RCMessageCell
, so custom message cells also need to inherit from RCMessageCell
. For more details, see Modifying Message Display Styles.
You can also directly replace the style resources, string resources, and icon resources referenced in the file message display template in RCIMKitTheme.bundle
.
Hiding the File Message Entry
If you need to dynamically modify it, you can remove the specified expand item through inputBar.addExpandItems
of RCChatViewController
before the chat UI is displayed.
[self.inputBar.addExpandItems removeObjectAtIndex:2];
For more details, see Input Area.