Step1: Install SDK
This article mainly introduces how to quickly integrate the RTC Room Engine SDK into your iOS project.
Environment Requirements
Xcode 15 or later.
iOS 13.0 or later.
CocoaPods environment setup, Click to view.
The project has been configured with a valid developer signature.
Integrating SDK
Option 1:Use CocoaPods
Install CocoaPods
Enter the following command in a terminal window (you need to install Ruby on your Mac first):
sudo gem install cocoapods
Create Podfile File
Navigate to the path where the project is located and run the following command. Then, a Podfile will appear under the project path.
pod init
Edit Podfile File
Please set the Podfile as follows:
platform :ios, '13.0'target 'App' douse_frameworks!# Add RoomEngine SDKpod 'RTCRoomEngine'end
Update and install the SDK
Enter the following commands in the terminal window to update the local library files and install the Chat SDK:
pod install
Or run this command to update the local repository:
pod update
After the pod command is executed, an .xcworkspace file integrated with the SDK will be generated. Double-click to open it. If the pod search fails, it is recommended to try updating the local repo cache of the pod. The update command is as follows:
pod setuppod repo updaterm ~/Library/Caches/CocoaPods/search_index.json
Option 2: Use Spm
1. Open your Xcode project, and in the Xcode menu, click File > Add Package Dependencies... .
2. In the pop-up dialog box, enter the URL in the upper right corner: https://github.com/Tencent-RTC/RTCRoomEngine_SwiftPM.git.
3. Select Dependency Rule as Branch, and set the branch name to main, or choose the version number you need, then select the current project by clicking Add to Project.
4. Click Add Package to enter the target settings interface.
5. Click the Add Package to complete the integration.
Cite RoomEngine SDK
Then, in the file where the project needs to use the SDK API, import the RoomEngine module.
import RTCRoomEngine
FAQs
Xcode 15 Developer Sandbox Option Problem
Sandbox: bash(xxx) deny(1) file-write-create
When creating a new project with Xcode 15, you may encounter compilation failures due to this option. It is recommended to turn off this option.