# Prepare the Development Environment

This chapter will introduce how to integrate the SDK into a project you created.

# Prerequisites

# Create an iOS project

Follow the steps below to create an iOS project. If you have an iOS project, you can directly check the step of integrating JC SDK.

  • Open Xcode and click Create a new Xcode project.

  • Select the project type as Single View App and click Next.

  • Enter the project information, such as project name, development team information, organization name and language, and click Next.

TIP

If you have not added the information of development team, click Xcode \Preferences… -> Accounts, click the plus sign in the lower left corner and follow the on-screen prompts to log in your Apple ID. After that, you can choose your account as the development team.

  • Select the project storage path and click Create.

  • Connect your iOS device to the computer.

  • Go to the TARGETS -> Project Name -> Signing & Capabilities menu and check Automatically manage signing.

# Integrate SDK

You can integrate JC SDK in any of the following three ways:

# Method 1: Automatically import dynamic library through CocoaPods

Version 2.0 and above support you to import the SDK through CocoaPods. Before importing, CocoaPods environment needs to be installed, please refer to CocoaPods official (opens new window) website for installation method.

After the CocoaPods environment is installed, take the following steps:

  1. Open Terminal, cd to the project root directory.

  2. Execute pod init, a Podfile text file will be generated under the project folder.

  3. Run open -e Podfile.

  4. Add import configuration pod 'JuphoonCloudSDK_iOS', '-> version' (replace version with the SDK version that you need to integrate with) .

  5. Execute pod install .After successful installation, Pod installation complete\! will be displayed in Terminal. At this time, an xcworkspace file will be generated under the project folder.

  6. Double-click to open the xcworkspace file.

The revised content is as follows. Pay attention to replace Your App with your Target name:

platform :ios, '9.0'
#use_frameworks!
target 'Your App' do
pod 'JuphoonCloudSDK_iOS', 'version'
end

TIP

If you need to update the local library version, execute the pod update command before executing pod install.

# Method 2: Manually import the dynamic library

  1. Download and extract JC SDK (opens new window)

  2. Copy the JCSDKOC.framework and include in the sdk folder to the directory where your project is located.

  3. Open Xcode and go to TARGETS -> Project Name -> General, in Embedded Binaries column, click the + symbol, and then import JCSDKOC.framework under the JCSDK folder.

  4. Click Build Settings, find Search Paths, and set the Framework Search Paths:

  • Framework Search Paths:$(PROJECT_DIR)/.. /sdk

  • Header Search Paths:$(PROJECT_DIR)/.. /sdk/include

    TIP

    After completing step 1 to import the jcsdkoc.framework file, xcode automatically generates the path if xcode there is no automatic generation of paths, users have to follow JCSDKOC.FRAMEWORK In the directory where the file is located, set the path manually.

  1. Go to Target -> Build Settings -> Other Linker Flags in the project and add it to this item -ObjC。

  2. Click Build Settings, find Documentation Comments and set to NO.

  3. Go to the project's Target -> Signing & Capabilities -> Background Modes, check the following:

    • Audio, AirPlay, and Picture in Picture

# Add project permissions

Audio and video calls require camera and microphone permissions. Please add the following key values in the info.plist of the project:

Key

Type

Value

Privacy - Microphone Usage Description

String

Use the microphone for purposes like voice calls.

Privacy - Camera Usage Description

String

Use the camera for purposes like video calls.

最后更新时间: 1/17/2023, 5:17:17 PM