logo
On this page

Integrate SDK


Prepare Environment

Before integrating the ZEGO Express SDK, please ensure your development environment meets the following requirements:

  • Xcode 15.0 or later.
  • A macOS device running macOS 10.13 or later.
  • The macOS device is connected to the Internet.

Integrate SDK

(Optional) Create a new project

  1. Launch Xcode, click "Create a new Xcode project" in the "Welcome to Xcode" window, or select "File > New > Project" from the menu. In the form that appears, select the macOS platform, and select "App" under "Application".

  2. Fill out the form and select various options to configure your project, then click "Next".

    You must provide "Product Name" and "Organization Identifier", which are used to create the unique identifier "Bundle Identifier" for the App.

  3. Select the project storage path and click "Create" to create the project.

Import SDK

Developers can integrate the SDK using any of the following methods.

Method 1: Use CocoaPods for automatic integration

  1. Install CocoaPods. For common installation issues, please refer to CocoaPods FAQ - Installing CocoaPods.

  2. Open Terminal, navigate to the project root directory, and run the pod init command to create a Podfile.

  3. Open the Podfile and add pod 'ZegoExpressAudio-macOS' under "target". You need to replace "MyProject" with your Target name.

Warning
  • Since the SDK is an XCFramework, CocoaPods v1.10.0 or later is required to integrate this SDK.
  • Starting from version v3.2.0, the Pod name for Express Real-time Audio/Video Video SDK changed from ZegoExpressEngine/Video to ZegoExpressEngine-macOS; the Pod name for Express Real-time Voice Audio SDK changed from ZegoExpressEngine/Audio to ZegoExpressAudio-macOS.
target 'MyProject' do
    use_frameworks!
    # Please specify the specific SDK version number
    # Please check the SDK latest version from the release notes and modify x.y.z to the specific version number
    pod 'ZegoExpressAudio-macOS', '~> x.y.z'
end
  1. Run the pod repo update command to update the local index to ensure the latest version of the SDK can be installed. For the latest version number, please refer to the release history in Download Documentation.

  2. Run the pod install command to install the SDK.

Note

Method 2: Copy SDK files for manual integration

  1. Please refer to Download SDK Package, download the latest version of the SDK and extract it.

  2. Manually copy the SDK dynamic library file "ZegoExpressEngine.xcframework" to your project directory.

  3. Open Xcode, select "File > Add Files to "xxx"" (xxx is the project name) menu, add the SDK library files to the project.

  4. Select "TARGETS > General > Frameworks,Libraries,and Embedded Content" menu, add "ZegoExpressEngine.xcframework", and set "Embed" to "Embed & Sign".

Set Permissions

Set the required permissions for the app according to actual application needs.

In Xcode, select "TARGETS > Signing & Capabilities > App Sandbox" menu, check the permissions required by the SDK.

  • Network - Incoming Connections (Server)
  • Network - Outgoing Connections (Client)
  • Hardware - Audio Input

How to reduce the App size of integrated Native SDK?

Previous

Run Example Source Code

Next

Implementing Voice Call

On this page

Back to top