Announcing OpenTok Support for Bitcode in Beta

bitcodeWe’re happy to announce the release of the OpenTok 2.7.1-beta.1 Bitcode version.

Apple added Bitcode binary support for developer apps as part of the app thinning process. The reason behind this is to minimize the end user download app size.  Prior to Xcode 7 & iOS 9, developers upload the native binary and it’s the final executable that users download.

A native binary can’t be re-optimized once it is created. Now with Xcode 7 users have the option to upload Bitcode binaries and Apple can re-optimize them in the future when there are latest compiler options available with out requesting developers to re-submit the app. Apple also says that they can also create native code for future devices from Bitcode without resubmission of the app from the developer.

What is Bitcode

Bitcode is part of LLVM compiler Infrastructure.  It is basically a bitstream container format that contains encoded LLVM IR.  LLVM IR is an Intermediate step in the compilation cycle, It will then be further optimized into a native binary. You can run Bitcode binaries which match with host architecture using lli tool.

Changes to the app submission flow:

Non-Bitcode app submission flow OpenTok

Bitcode app submission flow OpenTok

Why we’re supporting Bitcode

We believe in providing support for the technologies that our developers want to use. If a developer wants to build/submit an app in Bitcode format, all third party libraries that the app uses should be in Bitcode format. That’s why we’re providing both Bitcode and non-Bitcode versions for convenience.

How to build your app using OpenTok iOS Bitcode

To enable Bitcode :

  1. Select your project file in Xcode
  2. Select your App Target in the project editor left pane
  3. Go to build settings
  4. Go to Build Options
  5. Set YES for “Enable Bitcode”

Points to note:

  • The OpenTok Bitcode SDK size is bigger (72.5M) than the non-Bitcode version due to LLVM IR
  • Bitcode is platform and subarch dependent so the OpenTok Bitcode version will have the same number of slices that we provide in the non-Bitcode version
  • ARM assembly in WebRTC will be intact in Bitcode and final native code
  • Developers can generate non-Bitcode apps from the Bitcode version of the OpenTok SDK
  • Bitcode binaries are option for iOS devices and required for Apple watchOS2

Interested in joining the beta program or have questions? Send an email to ios-bitcode-beta@tokbox.com.