# 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 static libraries 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. Unpack and open the downloaded JC SDK (opens new window) dynamic library. The sdk file directory includes the JCSDKOC.framework file.

  2. Copy the sdk folder to the directory where your project is located.

  3. Import SDK

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

  4. Set path

    Click ‘Build Settings’, find Search Paths, set Framework Search Paths, Header Search Paths (header file path) and Library Search Paths (library file path):

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

    TIP

    After importing JCSDKOC.framework and two .a files in step 1, Xcode will automatically generate the path. If Xcode does not automatically generate the path, the user should manually set the path according to the directory where the JCSDKOC.framework file is located.

  5. Set the parameters of Other Linker Flags to -ObjC

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

  6. Set Documentation Comments to NO

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

  7. Set the background operation mode

    Enter Target -> Signing & Capabilities -> Background Modes of the project, check the following items:

    • 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/5/2022, 1:39:33 PM