Skip to main content

Importing the SDK

You can choose any of the following methods:

  • Use CocoaPods to add remote dependencies and import the Framework
  • Manually import the Framework
  • Starting from version 5.12.2, IMLib SDK can be imported via Swift Package Manager

Environment Requirements

  • Xcode version 11 or higher is required
  • Apple devices must run iOS 9.0 or later
  • If you plan to integrate the SDK via CocoaPods, CocoaPods 1.10.0 or higher is required. This is because IMLib SDK changed to XCFramework after version 5.1.1, and CocoaPods only fully supports XCFramework integration starting from version 1.10.0. For details, refer to the Knowledge Base Documentation.
  • Swift Package Manager requires Swift 5.0 or higher

To install the CocoaPods environment, refer to Installing CocoaPods.

Version Check

Before importing the SDK, you can visit the RC Official Website SDK Download Page to confirm the latest version number.

CocoaPods

  1. If your project doesn't have a Podfile, open Terminal, navigate to your project's root directory, and run the pod init command. This will automatically create a default Podfile. Then add the following content to the Podfile:

    pod 'RongCloudIM/IMLib', '~> x.y.z'
    tip

    Here, x.y.z represents the specific version number of IMLib. You can check the latest version of IMLib on the RC Official Website SDK Download Page or by first running pod repo update and then pod search RongCloudIM in Terminal to query the CocoaPods repository.

  2. Open Terminal, navigate to the directory containing the Podfile, and run the following command:

    pod install
    tip

    If you encounter errors like CocoaPods could not find compatible versions for in Terminal, first run the pod repo update command, then execute pod install.

  3. Open the xcworkspace file in your project directory using Xcode to load the project.

Swift Package Manager

tip

IMLib SDK supports Swift Package Manager integration starting from version 5.12.2.

  1. Open your Xcode project.
  2. Click File > Add Package Dependency.
  3. In the search box at the top right of the pop-up window, paste either of the following URLs:
  4. Xcode will display a list of RC SDK components. IMLibCore provides core IM capabilities, while other components can be selected based on your business needs.

Component Introduction

The RC IM SDK provides the following components for developers to choose from. IMLibCore is the core component, while others can be combined based on actual business requirements:

Swift PackageDynamic LibraryDescription
IMLibCoreRongIMLibCore.xcframeworkCore IM functionality
ChatRoomRongChatRoom.xcframeworkChatroom functionality (includes IMLibCore)
CustomerServiceRongCustomerService.xcframeworkCustomer service functionality (includes IMLibCore)
DiscussionRongDiscussion.xcframeworkDiscussion group functionality (includes IMLibCore)
PublicServiceRongPublicService.xcframeworkOfficial Account functionality (includes IMLibCore)

Manual Integration

  1. Visit the RC Official Website SDK Download Page to download the IMLib SDK locally.

  2. Open your project in Xcode and manually drag the downloaded SDK into your project. The required SDK components are:

    FrameworkResource Files
    IMLib
    • RongIMLib.xcframework
    • RongIMLibCore.xcframework
    • RongChatRoom.xcframework
    • RongCustomerService.xcframework
    • RongLocation.xcframework (versions 5.2.5 and later: no need to import)
    • RongDiscussion.xcframework
    • RongPublicService.xcframework
    • RCConfig.plist
    Translation (Optional)
    • RongTranslation.xcframework
    tip

    The SDK only supports the Translation plugin starting from version 5.2.2, and this plugin is currently only available for applications using the Singapore data center.

  3. Modify your project configuration. In General -> Frameworks,Libraries,and Embedded Binaries, change all manually imported IMLib SDK Frameworks to Embed & Sign.