Before integrating the ZEGO Express SDK, make sure the development environment meets the following requirements:
Skip this step if a project already exists.
Open Xcode, and in the Welcome to Xcode window, click Create a new Xcode project or select File > New > Project. In the dialog that appears, select the macOS tab, then select App in the Application section.
Fill in items or choose options for the new project, click Next after configuration is completed.
Product Name and Organization Identifier are required, which will be used for creating the App UID - Bundle Identifier.
Choose a particular directory to restore the project to be created, and click Create to create a project.
Choose either of the following methods to integrate the ZEGO Express SDK into your project.
Install CocoaPods. For more details, see CocoaPods Installation Guide .
Open the Terminal, enter the root directory of the project, and execute the command pod init
to create a Podfile
.
Open Podfile
, add pod 'ZegoExpressAudio-macOS'
, and change MyProject
to your target name.
Because the SDK is XCFramwork, therefore, you will need to use CocoaPods 1.10.0 or later to integrate the Zego Express SDK.
Since version v3.2.0, the Pod name of the Express Video Call SDK is changed from ZegoExpressEngine/Video
to ZegoExpressEngine-macOS
; the Pod name of the Express Voice Call SDK is changed from ZegoExpressEngine/Audio
to ZegoExpressAudio-macOS
.
target 'MyProject' do
use_frameworks!
# Please fill in a specific SDK version number
# You can get the latest version of the SDK from release note, and modify x.y.z to the specific version number
pod 'ZegoExpressAudio-macOS', '~> x.y.z'
end
Execute pod repo update
to update the local index to make sure the latest version of SDK can be installed. For the latest version number, see ZEGO Express-Audio macOS SDK Release History .
Execute pod install
to install the SDK.
For common problems you may encounter when using CocoaPods, see CocoaPods FAQ .
Download the latest version of SDK from SDK downloads . We recommend you use XCFramework, and then extract files from the downloaded SDK package.
Copy the SDK dynamic library file ZegoExpressEngine.xcframework
to the project directory.
Open Xcode and select File > Add Files to "xxx" (xxx is the project name) to add the SDK dynamic library files to the project.
Do the following to add the framework file to the project target.
a) Select the project target.
b) Click General, then under Frameworks, Libraries, and Embedded Content, click the Add button (+) below the table.
c) Add ZegoExpressEngine.framework to the target, and set the Embed field to Embed & Sign.
Permissions can be set as needed.
Open Xcode, select the target object, and then click Signing & Capabilities > App Sandbox, add the permissions required by the SDK.
Network - Incoming Connections (Server)
Network - Outgoing Connections (Client)
Hardware - Audio Input