Skip to main content

Upgrading from IMKit 4.X to 5.X

Upgrading to IMKit 5.4.0

In IMKit 5.4.0, the SDK has removed its internal dependency on RongIMLib.

If you're upgrading from a lower version to IMKit 5.4.0 and your project calls methods from the RCIMClient class, errors may occur. Should this happen, replace RCIMClient method calls with their counterparts in RCCoreClient.

Exception: If your IMKit project involves chatroom functionality, replace calls to RCIMClient methods with equivalent methods from RCChatRoomClient.

Upgrading from 2.X/4.X to IMKit 5.X

Upgrading from IMKit 2.x/4.x to 5.x involves changes to the following components. If these aren't used in your project, the upgrade should be seamless:

  • RCIM
  • RCMessageCell
  • RCChatSessionInputBarControl
  • RCPluginBoardView
  • Removed conversation settings pages: RCSettingViewController and RCConversationSettingTableViewController
  • RCImagePreviewController
  • RCKitUtility
  • Resource image changes
  • Message bubble stretch ratio adjustments
  • RTC resource image migration
  • Custom message cell registration timing

Details below:

1. RCIM Interface Changes

When upgrading from 4.x to 5.x, note that configuration properties have moved to the RCKitConfig class.

/// Deprecated RCIM interfaces (configurations moved to RCKitConfig)
@interface RCIM (Deprecated)

@property (nonatomic, assign) BOOL disableMessageNotificaiton __deprecated_msg("Deprecated. Use RCKitConfigCenter.message.disableMessageNotificaiton instead");

@property (nonatomic, assign) BOOL disableMessageAlertSound __deprecated_msg("Deprecated. Use RCKitConfigCenter.message.disableMessageAlertSound instead");

// ... (similar deprecation notices for all other properties)
@end

2. RCMessageCell Changes

@property (nonatomic, strong) UIView *messageHasReadStatusView;

This deprecated property has been removed. Use the existing statusContentView instead.

3. RCChatSessionInputBarControl Updates

3.1 Removed Method

- (void)imageDidSelect:(NSArray *)selectedImages fullImageRequired:(BOOL)full __deprecated_msg("Deprecated. Do not use.");

Replace with:

- (void)imageDataDidSelect:(NSArray *)selectedImages fullImageRequired:(BOOL)full;

3.2 Enum Migration

All enums in RCChatSessionInputBarControl have been moved to RCExtensionKitDefine.

4. RCPluginBoardView Enhancements

Extension panel button insertion/update methods now include a highlightedImage parameter for click-state visuals:

- (void)insertItem:(UIImage *)normalImage highlightedImage:(UIImage *)highlightedImage title:(NSString *)title atIndex:(NSInteger)index tag:(NSInteger)tag;

- (void)insertItem:(UIImage *)normalImage highlightedImage:(UIImage *)highlightedImage title:(NSString *)title tag:(NSInteger)tag;

// ... (similar updates for all related methods)

5. Removed Setting Pages

RCSettingViewController and RCConversationSettingTableViewController have been removed. For implementation references, see the conversation settings pages in the official SealTalk demo source code.

6. RCImagePreviewController Replacement

The single-image preview controller has been replaced with RCImageSlideController:

RCImageSlideController *imagePreviewVC = [[RCImageSlideController alloc] init];
imagePreviewVC.messageModel = model;
imagePreviewVC.onlyPreviewCurrentMessage = YES; // Set to NO for swipe-through preview of all images
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:imagePreviewVC];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:nav animated:YES completion:nil];

7. RCKitUtility Method Removal

This alert controller method has been moved to RCAlertView:

+ (void)showAlertController:(NSString *)title
message:(NSString *)message
preferredStyle:(UIAlertControllerStyle)style
actions:(NSArray<UIAlertAction *> *)actions
inViewController:(UIViewController *)controller;

8. Resource Image Naming Updates

  • Extension panel images now use plugin_item_ prefix
  • Input bar icons now use inputbar_xxx naming convention
  • Update custom image replacements accordingly

9. Message Bubble Stretch Ratio Adjustment

/// Original stretch ratio:
UIEdgeInsetsMake(image.size.height * 0.8, image.size.width * 0.2, image.size.height * 0.2, image.size.width * 0.8)

/// New stretch ratio:
UIEdgeInsetsMake(image.size.height * 0.5, image.size.width * 0.5, image.size.height * 0.5, image.size.width * 0.5)

10. RTC Resource Migration

RongIMKit no longer contains RTC-related resources from RongCallKit (images/language files). These are now bundled with RongCallKit.

11. Custom Message Cell Registration Timing

For custom message cells, registration must occur first in the conversation view controller's viewDidLoad before any other operations.