Zoom SDK Integration for iOS — Swift

Image for post
Image for post

Hey all, I have a hope that you were tired of searching Zoom SDK integration iOS in swift. Because, even me. 😜

In the Zoom marketplace documentation, they have mentioned it for Objective-C. So I have planned to give you the Swift version.

I’m taking you to do the topic directly. I don’t want to explain the documentations. I have another hope that you might read that before itself. Well, my hope may fail. But I don’t want that. 😝

Creating Xcode project

Image for post
Image for post
  1. Register your app ID and create the provisioning profiles.
  2. If you don’t want to test this demo app on the iOS device, you can skip the above step. I prefer you to do :)
  3. Else you can continue the testing in the simulator itself.
Image for post
Image for post

You can do download Zoom SDK official website.

  1. Select MobileRTC framework and MobileRTCResources bundle files from the downloaded Zoom SDK folder
Image for post
Image for post

2. Drag and Drop the file into the project folder

Image for post
Image for post

4. Now, you have to do two things:

i) Go to General -> Frameworks, Libraries and Embedded Content and change embed type to Embed & Sign

Image for post
Image for post

ii) Go to Build Settings-> Build Options and enable Bitcode to No

Image for post
Image for post

Currently, Zoom doesn’t support this. It might give you an error. So, I recommended you to delete the followings:

  1. Application Scene Manifest from the info.plist file
Image for post
Image for post

2. SceneDelegate.swift file

Image for post
Image for post

3. UISceneSession Lifecycle methods from the AppDelegate.Swift and declare UIWindow

Image for post
Image for post

Everything is fine, you wont get any error at this stage.

You can create Zoom account here.

Build your SDK app

After login into the marketplace, you have options to build your app

Image for post
Image for post

Build your SDK app

  1. Create SDK app and fill all details
Image for post
Image for post

2. After creating, you will get the SDK Key and SDK Secret

Image for post
Image for post

3. Add you keys into the project

Image for post
Image for post

You have to authenticate the SDK keys. Add the following method into the AppDelegate.swift file

func setupSDK(_ sdkKey: String?, sdkSecret: String?) {
let context = MobileRTCSDKInitContext()
context.domain = "zoom.us"
context.enableLog = true
let sdkInitSuc = MobileRTC.shared().initialize(context)
if sdkInitSuc {
let authService = MobileRTC.shared().getAuthService()
if let authService = authService {
authService.clientKey = sdkKey
authService.clientSecret = sdkSecret
authService.delegate = self
authService.sdkAuth()
}}
}

We have MobileRTCAuthDelegate to handle errors.

extension AppDelegate :MobileRTCAuthDelegate{func onMobileRTCAuthReturn(_ returnValue: MobileRTCAuthError) {switch returnValue {case MobileRTCAuthError_Success:
print("SDK successfully initialized.")
case MobileRTCAuthError_KeyOrSecretEmpty:
print("SDK key/secret was not provided. Replace sdkKey and sdkSecret at the top of this file with your SDK key/secret.")
case MobileRTCAuthError_KeyOrSecretWrong:
print("SDK key/secret is not valid.")
case MobileRTCAuthError_Unknown:
print("SDK key/secret is not valid.")
default:
print("SDK Authorization failed with MobileRTCAuthError: \(returnValue)")
}
}

Am done with it. 🙌

Everything is fine, you wont get any error at this stage and you have successfully integrated Zoom SDK into your iOS project.

Am planning to write another article regarding how to do join & start meeting within your iOS App. Stay turned 💪

Cheers 🍻

 iOS Developer @nfnlabs, Chennai. Here to share best practices learned through my experience. Reach me on https://www.linkedin.com/in/ashokkumar-b-26026913a/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store