Skip to main content

Configuration Guide

The IMKit SDK global configuration is designed to provide easy-to-use feature settings, helping you quickly build chat applications.

Configuration Overview

IMKit SDK global configurations are categorized into the following modules. Refer to the corresponding files to explore all available configurations.

CategoryDescriptionAPI DocumentationSource Code
Feature ConfigurationControls message quoting, emoji input disabling, local notification sounds/vibration, etc.FeatureConfigFeatureConfig.java
Conversation List ConfigurationManages avatars, pagination, refresh delays in conversation lists.ConversationListConfigConversationListConfig.java
Chat UI ConfigurationConfigures read receipts, message recall, retry, forwarding, default history message count, unread bubbles, @mention badges.ConversationConfigConversationConfig.java
Aggregated Conversation ConfigurationCustomizes titles/avatars for aggregated conversations.GatheredConversationConfigGatheredConversationConfig.java
Notification ConfigurationControls silent notifications, title types, and notification categories.NotificationConfigNotificationConfig.java

Modifying IMKit Configurations

The RongConfigCenter class serves as the entry point for modifying SDK configurations.

During initialization, RongConfigCenter first loads default settings from rc_config.xml. You can override these by creating res/values/rc_config.xml or dynamically adjust configurations via RongConfigCenter methods.

Configuration Examples

// Disable message quoting
RongConfigCenter.featureConfig().enableReference(false);

// Set conversation list refresh delay (prevents UI lag. Note: Cannot set to 500ms)
RongConfigCenter.conversationListConfig().setDelayRefreshTime(1000);

// Make conversation list avatars circular (only applies after custom avatar setup)
RongConfigCenter.featureConfig().setKitImageEngine(new GlideKitImageEngine() {
@Override
public void loadConversationListPortrait(@NonNull Context context, @NonNull String url, @NonNull ImageView imageView, Conversation conversation) {
Glide.with(context).load(url)
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
.into(imageView);
}
});

// Make chat message avatars circular (only applies after custom avatar setup)
RongConfigCenter.featureConfig().setKitImageEngine(new GlideKitImageEngine() {
@Override
public void loadConversationPortrait(@NonNull Context context, @NonNull String url, @NonNull ImageView imageView, Message message) {
Glide.with(context).load(url)
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
.into(imageView);
}
});

// Enable remote message deletion (Since 5.2.3)
RongConfigCenter.conversationConfig().setNeedDeleteRemoteMessage(true);

// Mute notifications when app is in foreground (non-chat pages)
RongConfigCenter.notificationConfig().setForegroundOtherPageAction(ForegroundOtherPageAction.Silent);

Verifying IMKit Configurations

Configuration changes take effect immediately upon the next UI refresh or operation. We recommend completing all configurations after initializing IMKit.

Exception: The quick reply feature must be enabled before initialization (RongConfigCenter.featureConfig().enableQuickReply()) to function properly.