iOS - Installation guide

Mobile SDK is built using Moya framework. In order to use CMMobileSDK you should import mentioned framework as well. There are few ways to import these frameworks, however the fastest one is to use CocoaPods

Moya and SwiftyJSON frameworks are used in the Demo app to perform additional calls with REST API like authentication, retrieving list of recordings. Feel free to use example code and extend it with other API calls.

Required versions

Name MobileSDKv2 MobileSDKv3 MobileSDKv3.4 MobileSDKv4.0 MobileSDKv4.1 MobileSDKv5.2.1.1 MobileSDKv5.2.4
iOS 8.0 + 8.0 + 8.0 + 9.0 + 10.0 + 10.0 + 10.0 +
Moya 9.0.0 9.0.0 13.0.0 14.0.0 14.0.0 14.0 14.0
Swift 3 4 4 5.1 5.1.2 5.1.2 5.1.2

Importing required frameworks into your project

  1. Install CocoaPods on your Mac if necessary (follow instructions at official site). 
  2. Open Terminal.
  3. Run "cd" command to folder which contains your project.
  4. Run "pod init" command, it will create Podfile at containing folder. 
  5. Open Podfile and insert next text:

  6. Save and close Podfile
  7. Run "pod install" commands. Note: close Xcode before executing command.
  8. YourProjectName.xcworkspace file was generated, open your project with this file now, not YourProjectName.xcodeproj.

Importing Mobile SDK into your project

  1. Add CMMobileSDK.framework file to your project.
  2. Add CMMobileSDK.framework to Embedded Binaries section of your target's General tab.
  3. Add next line at file where you plan to use it (for Swift): import CMMobileSDK
  4. Add next line at file where you plan to use it (for ObjC): 
    1. #import <CMMobileSDK/CMMobileSDK-Swift.h> to use CameraWizard/NuboCamWizard/AccessTokenProvider modules.
    2. #import <CMMobileSDK/CMMobileSDK.h> to use CameraSniffer/CameraStreamer modules.
  5. To support cameras with two-way audio, please make sure to add NSMicrophoneUsageDescription to your app's Info.list.

Apple does not accept applications submitted with FAT frameworks (those include 4 slices: i386, x86_64, armv7, arm64 and can be run on both Simulator and real device) because framework size is twice larger but it's useless - you can't install app from AppStore to Simulator.

That's why we will provide you two versions of framework: one for testing on Simulator/device (with i386 x86_64 armv7 arm64 slices) and another for release (with armv7, arm64 slices).

Demo app is using FAT framework and doesn't include shell script to copy right version of framework depending on build configuration: FAT for Debug, AdHoc and Device-only for Release - you should add such scripts by yourself (or just replace FAT framework with Device-only version manually before submitting to AppStore). You can easily distinguish them by comparing sizes - FAT framework would be roughly twice larger.