-
Notifications
You must be signed in to change notification settings - Fork 209
Developing a native iOS app
If you haven't read Developing iOS apps you should read that first.
Native apps use the OpenWebRTC C API, which provides the maximum flexibility and the best performance. To simplify development of native apps we provide the OpenWebRTC iOS SDK. The SDK is packaged in CocoaPods. You can develop native apps without the SDK, but the remainder of this tutorial assumes the SDK is used.
We use our example app NativeDemo as a reference. The source code for the app can be found here.
##1. Installing CocoaPods If you haven't installed CocoaPods yet, do so first:
sudo gem install cocoapods
pod setup
##2. Clone the iOS SDK Clone the OpenWebRTC iOS SDK next to the folder where you intend to develop your new app.
##3. Create a new Xcode project You know what to do.
##4. Create the Podfile and install it
Create a Podfile and put it in the same folder as your .xcproject
file:
platform :ios, '8.0'
target 'NativeDemo' do
pod 'OpenWebRTC-SDK', :path => '../../../openwebrtc-ios-sdk/OpenWebRTC-SDK.podspec'
end
Note! Please make sure the relative path to the OpenWebRTC-SDK.podspec
is correct.
Now run pod install
. This should generate a new .xcworkspace
file. Open it.
##5. Initiate OpenWebRTC in your AppDelegate For example:
#import "NativeDemoAppDelegate.h"
#import <OpenWebRTC-SDK/OpenWebRTC.h>
@implementation NativeDemoAppDelegate
+ (void)initialize
{
if (self == [NativeDemoAppDelegate class]) {
[OpenWebRTC initialize];
}
}
##6. Set up video views