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.
Category | Description | API Documentation | Source Code |
---|---|---|---|
Feature Configuration | Controls message quoting, emoji input disabling, local notification sounds/vibration, etc. | FeatureConfig | FeatureConfig.java |
Conversation List Configuration | Manages avatars, pagination, refresh delays in conversation lists. | ConversationListConfig | ConversationListConfig.java |
Chat UI Configuration | Configures read receipts, message recall, retry, forwarding, default history message count, unread bubbles, @mention badges. | ConversationConfig | ConversationConfig.java |
Aggregated Conversation Configuration | Customizes titles/avatars for aggregated conversations. | GatheredConversationConfig | GatheredConversationConfig.java |
Notification Configuration | Controls silent notifications, title types, and notification categories. | NotificationConfig | NotificationConfig.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.