Development Environment Configuration
For iOS development, Mac hardware, OSX operating system, Apple account and Xcode IDE created by Apple are basically required.
For Apple account creation and Xcode installation, refer to Apple’s official document below.
Preparing PlayRTC iOS SDK
Create Xcode Project
- Select File> New> Project> iOS> Application> Other> Empty and create an empty project.
- Select product name. In this example, it is assumed that the name is designated as MyApp.
Copy PlayRTC SDK
Download file from the link below.
When you decompress the downloaded folder, you will find one a extension file, one dat extension file and a number of header files with h extension. Arrange them as of the following for the project you wish to work on.
- [PROJECT-ROOT]/PlayRTC/public/PlayRTC.h and other h extension files
Now, include SDK file copied according to the preparation procedures in the Xcode bulid environment below.
Prepare Xcode Build Environment
Copy SDK to project folder as of the above and configure build environment.
Import PlayRTC SDK
Import SDK copied to the project in the previous stage as of the following and include it in the build process.
- Files > Add Files to “MyAPP”
- Select [PROJECT-ROOT]/PlayRTC folder
- Select Added Folders > Create Groups
- Select Add to Targets> MyApp
- Click Add
Linked Frameworks and Libraries
Set the linked library as of the following in MyApp> Targets> MyApp> General> Linked Frameworks and Libraries.
Set the following in MyApp> Targets> MyApp> Build Settings.
If SDK version to apply is 32Bit, set 32Bit in Architecture below. If 64Bit, set 64Bit. According to Apple’s iOS App Store policy, 64Bit architecture must be supported for app registration. Therefore, it is recommended to set and apply 64Bit SDK and architecture.
- Architecture – 32Bit
- Architecture : $(ARCHS_STANDARD), $(ARCHS_STANDARD_INCLUDING_64_BIT)
- Build Active Architecture Only : NO
- Valid Architecture : armv7
- Architecture – 64Bit
- Architecture : $(ARCHS_STANDARD_INCLUDING_64_BIT)
- Build Active Architecture Only : NO
- Valid Architecture : arm64
- Other Linker FLags : -ObjC
- Apple LLVM 6.1 – Language
- C Language Dialect : C99[-std=c99]
- Apple LLVM 6.1 – Language – C++
- C++ Language Dialect : C++11[-std=c++11]
Set the following in MyApp> Targets> MyApp> Build Phases.
- Copy Bundle Resource
- icudtl.dat …in PlayRTC/libs
Prepare for Development with Objective-C
PlayRTC SDK is currently configured with Objective-C language. If preparation has been completed according to the procedures above, the environment for development with Objective-C has is completed.
Prepare for Development with Swift
To develop PlayRTC using Swift language, you need to draw up MyAppProjectName-Bridging-Header.h file as of the following and import header file of PlayRTC iOS SDK. Locate this file in the directory below.
The contents to be included in the file are as follows.
#ifndef MyAppProjectName_Bridging_Header_h #define MyAppProjectName_Bridging_Header_h #import "PlayRTC.h" #import "PlayRTCData.h" #import "PlayRTCDataHeader.h" #import "playRTCDataObserver.h" #import "PlayRTCDataSendObserver.h" #import "PlayRTCDefine.h" #import "PlayRTCFactory.h" #import "PlayRTCMedia.h" #import "PlayRTCObserver.h" #import "PlayRTCSettings.h" #import "PlayRTCVideoView.h" #endif
After importing header file to project, designate header file build process as of the following.
- MyApp > Targets > MyApp > Build Settings > Swift Compiler – Code Generation > Objective-C Bridging Header
- Designate Header File
For more details, refer to the link below.
Downloading Example App
Let’s download an example app and prepare the environment.
You can download an example app in a compressed file format from the link below.
$ git clone https://github.com/playrtc/PlayRTC-iOS-Code-Samples
Now, the environment for tutorial development has been completed. In the next chapter, we will start creating a video/ audio web app.