Build a Meeting SDK for iOS app

View as Markdown

Explore the Meeting SDK for iOS by learning how to build a simple meeting app to join and start a meeting.

  • Join a meeting - A user with a Zoom meeting ID and meeting passcode can join a meeting anonymously without having to log into the app.

  • Start a meeting - A meeting host can start the meeting after logging into the app with their Zoom account credentials.

Find an existing sample application with these features in your Meeting SDK download from our Marketplace.

Prerequisites

  • Xcode 
  • An iOS device (iOS 11 or later)
  • Client ID and Client Secret, obtained by creating an SDK app.

Learn how to create an iOS project and integrate the Meeting SDK for iOS into the project.

Create a new iOS project

  1. Open Xcode and select Create a new Xcode project.
  2. Choose Single View App as the template and select Next.
  3. Fill out the relevant project information such as the project name, team and organization name.
  4. Choose Storyboard in the User Interface field, choose a programming language, and select Next.
  5. Specify the storage path for the project, and select Create.
  6. Finally, connect your iOS device to your computer.

Import the Zoom SDK libraries

If you have not already downloaded the Zoom Client iOS SDK, download the SDK from the Zoom Marketplace.

To build with this version of the SDK in Xcode 13 or later, validate your workspace by navigating to Build Settings and setting Validate Workspace to YES.

The downloaded package includes SDK libraries and sample apps. The SDK libraries are in the lib folders located inside the zoom-sdk-ios-master folder. Navigate to the downloaded SDK package, and select MobileRTC.framework and MobileRTCResources.bundle.

Next, copy the selected files into your Xcode project file.

In the next screen, select Copy items if needed and Create folder references options and click Finish.

Next, embed and sign the framework by navigating to the Project file > Targets: > General > Frameworks, Libraries, and Embedded Content and setting the Embed attribute to Embed & Sign instead of Do Not Embed.

Change project configurations for SDK compatibility

If you built your project using Xcode version 11 or later, you may notice SceneDelegates being added to your project by default.

SceneDelegates are not compatible with the current version of the Zoom SDK. Thus, you must remove them from the iOS project. To do so, navigate to info.plist > Application Scene Manifest and delete it.

Next, delete the SceneDelegate files from the project navigator.

If you are using Objective-C for your project, delete SceneDelegate.m and SceneDelegate.h files from the project navigator. If you are using Swift, delete the SceneDelegate.swift file.

Lastly, navigate to AppDelegate file in the project navigator and remove the following UISceneSession code if it is present in the file.

AppDelegate.m
// If you are using Objective-C, delete the following lines of code from your AppDelegate.m file.
#pragma mark - UISceneSession lifecycle
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
    return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}
- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *) sceneSessions {
}

The Zoom SDK also does not support Bitcode, and Xcode enables it by default. Navigate to your Xcode project file, select Project > Build Settings and then, search for Enable Bitcode option and set the value of the option to No.

Add project permissions

Add the following permissions in the info.plist file to grant access to camera and microphone, needed for Zoom meetings to run on an iOS device. Navigate to info.plist, click the "+" icon next to Information Property List. Search for and select Privacy - Camera Usage Descriptions.

In the value of this field, provide a description to explain why you are requesting camera access, such as "To access the camera for a video meeting". Repeat this step for Privacy - Microphone Usage Description.

Now that the framework is installed and the project is set up, you can start setting up the SDK. The tabs below show instructions for both Objective-C and Swift. Follow the instructions that are relevant to you depending on the programming language that you are using for this project.

Initialize the SDK

Open the AppDelegate.h file. Since you disabled SceneDelegates earlier, add a UIWindow to the AppDelegate. Add this line of code to your AppDelegate.h file.

#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
// 1. Add UIWindow
@property (strong, nonatomic) UIWindow *window;
@end

The MobileRTC class exposes a generic interface to allow initialization, authentication, and configuration of the Meeting SDK. In order to use the Meeting SDK, import the MobileRTC class and provide your JWT Token for authentication while initializing the SDK.

First, open your AppDelegate.m file and import the SDK framework by adding this line of code.

#import <MobileRTC/MobileRTC.h>

Next, create a method named setupSDK that handles the initialization and authentication of the SDK. Add this code to AppDelegate.m.

// Provide JWT Token for authorization of SDK initialization.
- (void)setupSDK:(NSString *)jwtToken {
    MobileRTCSDKInitContext *context = [[MobileRTCSDKInitContext alloc] init];
    context.domain = @"zoom.us";
    context.enableLog = YES;
// Initialize the SDK
    BOOL sdkInitSuc = [[MobileRTC sharedRTC] initialize:context];
    if (sdkInitSuc) {
       // Get Auth Service
        MobileRTCAuthService *authService = [[MobileRTC sharedRTC] getAuthService];
        if (authService) {
       // Set up Auth Service
            authService.jwtToken = jwtToken;
            authService.delegate = self;
        // Call Authentication function to authenticate the SDK
            [authService sdkAuth];
        }
    }
}

Set up a delegate to listen to the SDK authorization updates. First, import the Meeting SDK library and have the AppDelegate conform to MobileRTCAuthDelegate by adding this code to AppDelegate.h.

#import <UIKit/UIKit.h>
// 1. Import Meeting SDK library
#import <MobileRTC/MobileRTC.h>
// 2. Declare that AppDelegate conforms to MobileRTCAuthDelegate
@interface AppDelegate : UIResponder <UIApplicationDelegate, MobileRTCAuthDelegate>
// 3. Call setUpSDK method.
-(void)setupSDK:(NSString *)jwtToken;
@property (strong, nonatomic) UIWindow *window;
@end

Next, in AppDelegate.m, set the delegate by declaring authorizationService.delegate = self and include the delegate functions to listen for changes in the SDK authorization state.

#import "ViewController.h"
#import <MobileRTC/MobileRTC.h>
@interface AppDelegate()
@end
@implementation AppDelegate
- (void)setupSDK:(NSString *)jwtToken {
    MobileRTCSDKInitContext *context = [[MobileRTCSDKInitContext alloc] init];
    context.domain = @"zoom.us";
    context.enableLog = YES;
    BOOL sdkInitSuc = [[MobileRTC sharedRTC] initialize:context];
    if (sdkInitSuc) {
        MobileRTCAuthService *authService = [[MobileRTC sharedRTC] getAuthService];
                if (authService) {
            authService.jwtToken = jwtToken;
           // Set the authService delegate.
            authService.delegate = self;
            [authService sdkAuth];
        }
    }
}
// Include MobileRTCAuthDelegate methods
#pragma mark - MobileRTCAuthDelegate
/**
* To monitor the status and catch errors that might occur during the authorization process, implement the onMobileRTCAuthReturn method
*/
- (void)onMobileRTCAuthReturn:(MobileRTCAuthError)returnValue {
    switch (returnValue) {
        case MobileRTCAuthError_Success:
            NSLog(@"SDK successfully initialized.");
            break;
        case MobileRTCAuthError_TokenWrong:
            NSLog(@"Client JWT Token Authentication is invalid.");
            break;
        default:
            NSLog(@"SDK Authorization failed with MobileRTCAuthError: %u", returnValue);
    }
}

In your AppDelegate.m file, under the didFinishLaunchingWithOptions method, add the setupSDK method along with your JWT token.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
/*
  Obtain your JWT Token and paste it here.
Your JWT Token should NEVER be publicly accessible. Only use the JWT Token for testing this demo app. For your production level application, generate a JWT using the Client Keys and Secret on the server side instead of storing it directly on the Client.
*/
    [self @""]; // TODO: Enter your JWT token here
    return YES;
}

Compare your files with the following samples to ensure that you have everything set up properly so far.

#import <UIKit/UIKit.h>
#import <MobileRTC/MobileRTC.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, MobileRTCAuthDelegate>
-(void)setupSDK:(NSString *)jwtToken;
@property (strong, nonatomic) UIWindow *window;

Select the Build and Run button in the top left corner. If the SDK has been initialized successfully, the app will deploy to your iOS device and you'll see a "SDK successfully initialized" message in the debugger.

If you run into Untrusted developer error on your device, resolve it by following these steps.

  • Navigate to Settings > General > Device Management.
  • Select the affected profile and trust it.

You've learned how to successfully integrate the Meeting SDK for iOS into your app.