Configuration Guide
IMKit provides global configurations for certain features to help you quickly build chat applications.
tip
RCKitConfig settings in IMKit take effect in real time. Modified configurations will apply during the next UI refresh or operation. We recommend completing all configurations after initializing IMKit.
Configuration Overview
IMKit defines global configurations in the RCKitConfig.h file, categorized into the following modules. Refer to the corresponding files to explore all available global configurations.
Category | Description | API Documentation | Source Code |
---|---|---|---|
Message Configuration | Controls message behaviors like auto-resend, foreground alerts, merge-forwarding, typing status, read receipts, and message recall. | RCKitMessageConf | RCKitMessageConf.h |
UI Configuration | Manages dark mode, layout direction, conversation list, avatars, message display, title sizing, etc. | RCKitUIConf | RCKitUIConf.h |
Font Configuration | Adjusts font sizes. | RCKitFontConf | RCKitFontConf.h |
Modifying IMKit Configurations
For iOS, use the RCKitConfig singleton (or the RCKitConfigCenter
macro) to modify IMKit configurations. Each application has only one global IMKit configuration.
Configuration examples:
// Maximum duration (in seconds) for message recall
RCKitConfigCenter.message.maxRecallDuration = 120;
// Enable video file inclusion when selecting media resources
RCKitConfigCenter.message.isMediaSelectorContainVideo = YES;
// Set avatar display style (default: rectangle, modified to rounded corners)
RCKitConfigCenter.ui.globalMessageAvatarStyle = RC_USER_AVATAR_CYCLE;
// Secondary title font size (default: 17 for text messages, quoted content, conversation list titles)
RCKitConfigCenter.font.secondLevel = 20;
// Customize file type icons by extension (Since 5.3.4)
[RCKitConfigCenter.ui registerFileSuffixTypes:types];