Skip to main content

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.

CategoryDescriptionAPI DocumentationSource Code
Message ConfigurationControls message behaviors like auto-resend, foreground alerts, merge-forwarding, typing status, read receipts, and message recall.RCKitMessageConfRCKitMessageConf.h
UI ConfigurationManages dark mode, layout direction, conversation list, avatars, message display, title sizing, etc.RCKitUIConfRCKitUIConf.h
Font ConfigurationAdjusts font sizes.RCKitFontConfRCKitFontConf.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];