This document describes how to quickly integrate the TRTC macOS SDK into your project.
You can use CocoaPods to automatically load the SDK or download and import it manually into your project.
Enter the following command in a terminal window (you need to install Ruby on your Mac first):
sudo gem install cocoapods
Go to the directory of your project and enter the following command to create a Podfile in the directory.
There are two ways to edit the Podfile:
Enter the following command in a terminal window to install the SDK.
Or, run this command to update the local repository:
An XCWORKSPACE project file integrated with LiteAVSDK will be generated. Double-click to open the file.
To use the audio/video features of the SDK, you need to grant it mic and camera permissions. Add the two items below to
Info.plist of your application. Their content is what users see in the mic and camera access pop-up windows.
If App Sandbox or Hardened Runtime is enabled for your application, select
You can import the TRTC SDK in two ways.
There are two ways to use the SDK in Objective-C or Swift:
Import the module: Import the SDK module in the files that will use the SDK APIs.
Import the header file: Import the header file in the files that will use the SDK APIs.
Import the header file: If you want to use C++ APIs to develop your macOS application, import the header file in the
Use the namespace: The cross-platform C++ APIs and types are all defined in the TRTC namespace, which you can use directly. This method can simplify your code and is recommended.
using namespace trtc;
For more information on how to use C++ APIs, please see Overview.