SDK Initialization


Contents

1. Initialize with SDK Domain
2. Set the SDK Resource Bundle's Path (Optional)
3. Set Root Navigation Controller (Optional)
4. Authenticate with Access Credentials 
5. Log feature

The shared instance of MobileRT exposes a generic interface to allow SDK initialization, authentication, and configuration.

Step 1: Create a MobileRTCSDKInitContext Object

MobileRTC = Zoom SDK

You will see the term “MobileRTC” in our iOS library, it is the technical name of our SDK library, you can treat it as the term “Zoom SDK”.

MobileRTCSDKInitContext* initContext = [[MobileRTCSDKInitContext alloc] init];
initContext.domain = @"https://zoom.us";
// Set your Apple AppGroupID here
initContext.appGroupId = appGroupID;
// Turn on SDK logging
initContext.enableLog = YES;
initContext.locale = MobileRTC_ZoomLocale_Default;
let initContext = MobileRTCSDKInitContext()
initContext.domain = "https://zoom.us"
// Set your Apple AppGroupID here
initContext.appGroupId = appGroupID
// Turn on SDK logging
initContext.enableLog = true
initContext.locale = .default
Please do not use raw IP address as the web domain

Please do not use raw IP address as the web domain as it will cause vulnerability issues. If you would like to learn why, please see our security practices for more information.

Step 2: Set the SDK Resource Bundle’s Path (Optional)

This step is optional. If and only if your MobileRTC Resource Bundle is included in another bundle or framework, please use this method to set its path.

// Set resource bundle path
NSString* bundlePath = [[NSBundle mainBundle] bundlePath];
initContext.bundleResPath = bundlePath
// Set resource bundle path
let bundlePath = Bundle.main.bundlePath
initContext.bundleResPath = bundlePath

Step 3: Set Root Navigation Controller (Optional)

This step is also optional. You can skip this step if your app’s Root View Controller is not a UINavigationController.

[[MobileRTC sharedRTC] setMobileRTCRootController:navigationController];
MobileRTC.shared().setMobileRTCRootController(navigationController)

Step 4: Authenticate with Access Credentials

To initialize the Zoom SDK, call initialize from the shared instance of MobileRTC. Then pass in the MobileRTCSDKInitContext object you created above. Once the SDK is initialized call getAuthService() to provide your JWT and MobileRTCAuthDelegate. Finally, sdkAuth() from the shared instance of MobileRTCAuthService.

MobileRTCSDKInitContext* initContext = [[MobileRTCSDKInitContext alloc] init];
initContext.domain = @"https://zoom.us";
// Set your Apple AppGroupID here
initContext.appGroupId = appGroupID;
// Turn on SDK logging
initContext.enableLog = YES;
initContext.locale = MobileRTC_ZoomLocale_Default;

if ([[MobileRTC sharedRTC] initialize:initContext]) {
    
    MobileRTCAuthService *authService = [[MobileRTC sharedRTC] getAuthService];
    if (authService) {
        authService.jwtToken = JWT;
        authService.delegate = authDelegate;
        
        [authService sdkAuth];
    }
}
let initContext = MobileRTCSDKInitContext()
initContext.domain = "https://zoom.us"
// Set your Apple AppGroupID here
initContext.appGroupId = appGroupID
// Turn on SDK logging
initContext.enableLog = true
initContext.locale = .default

if MobileRTC.shared().initialize(initContext) {

    if let authService = MobileRTC.shared().getAuthService() {
        authService.jwtToken = JWT
        authService.delegate = authDelegate

        authService.sdkAuth()
    }
}

For info on setting up your JWT, see the authentication section.

Monitor Auth Status

To monitor the status or catch errors during the initialization process, implement the onMobileRTCAuthReturn method:

- (void)onMobileRTCAuthReturn:(MobileRTCAuthError)returnValue
{
    switch (returnValue) {
        case MobileRTCAuthError_Success:
            NSLog(@"SDK auth success");
            break;
            
        default:
            NSLog(@"SDK auth failure. Error %lu", (unsigned long)returnValue);
            break;
    }
}
func onMobileRTCAuthReturn(_ returnValue: MobileRTCAuthError) {
    switch returnValue {
    case .success:
        print("SDK auth successful.")
    default:
        print("SDK auth failed: \(returnValue)")
    }
}
(returnValue == MobileRTCAuthError_Success) is the pre-requisite of every other services

You will not be able to use any other services(such as login, logout, join meeting, start meeting, etc.) if you do not receive a MobileRTCAuthError_Success value as the returnValue in the onMobileRTCAuthReturn method.

Log Feature

You can enable the log feature by setting the enableLog parameter to true in your MobileRTCSDKInitContext object:

initContext.enableLog = YES;
initContext.enableLog = true

Once the log feature is initialized, a log file will be created inside the sandbox of your application. The following steps shows how to retrieve your log file:

Step 1: Open the sandbox

In Xcode, select Devices and Simulators under Window menu:

Step 2: Download sandbox contents

Locate your application and press the small gear icon, then select “Download Container”:

Select a path to store the container contents, an xcappdata file will be created.

Step 3: Locate log file

Locate the xcappdata file created from the previous step, right click on the file and select “Show Package Contents”:

Inside the package contents, you will find the log file under: /AppData/tmp/

The log file has a 5MB storage capacity(fixed). Once it reaches the maximum capacity, it will auto re-record from the begining and overrider the previous data.