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
-
If your project doesn't have a
Podfile, open Terminal, navigate to your project's root directory, and run thepod initcommand. This will automatically create a defaultPodfile. Then add the following content to thePodfile:pod 'RongCloudIM/IMLib', '~> x.y.z'tipHere,
x.y.zrepresents 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 runningpod repo updateand thenpod search RongCloudIMin Terminal to query the CocoaPods repository. -
Open Terminal, navigate to the directory containing the
Podfile, and run the following command:pod installtipIf you encounter errors like
CocoaPods could not find compatible versions forin Terminal, first run thepod repo updatecommand, then executepod install. -
Open the
xcworkspacefile in your project directory using Xcode to load the project.
Swift Package Manager
IMLib SDK supports Swift Package Manager integration starting from version 5.12.2.
- Open your Xcode project.
- Click File > Add Package Dependency.
- In the search box at the top right of the pop-up window, paste either of the following URLs:
- 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 Package | Dynamic Library | Description |
|---|---|---|
| IMLibCore | RongIMLibCore.xcframework | Core IM functionality |
| ChatRoom | RongChatRoom.xcframework | Chatroom functionality (includes IMLibCore) |
| CustomerService | RongCustomerService.xcframework | Customer service functionality (includes IMLibCore) |
| Discussion | RongDiscussion.xcframework | Discussion group functionality (includes IMLibCore) |
| PublicService | RongPublicService.xcframework | Official Account functionality (includes IMLibCore) |
Manual Integration
-
Visit the RC Official Website SDK Download Page to download the IMLib SDK locally.
-
Open your project in Xcode and manually drag the downloaded SDK into your project. The required SDK components are:
Framework Resource 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
tipThe 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.
-
Modify your project configuration. In
General->Frameworks,Libraries,and Embedded Binaries, change all manually imported IMLib SDK Frameworks toEmbed & Sign.