Skip to main content
Explorer
Feb 16, 2024 6:51 AM UTC
Solved

Zoom meeting ios SDK is not working while bridging from react native

In obj C, I have added a UIViewcontroller from which zoom sdk will be intiated in viewDidLoad method as below,

// ZoomViewController.m

@implementation ZoomViewController
- (void)viewDidLoad {
  [super viewDidLoad];
  [self setupSDK:@"MY_APP_JWT_TOKEN"];
}
- (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.delegate = self;
      authService.jwtToken = jwtToken;
      [authService sdkAuth];
    }
  }
}


- (void)onMeetingStateChange:(MobileRTCMeetingState)state {
  NSLog(@"Meeting state: %ld", (long)state);
}

- (void)onMeetingReady:(MobileRTCMeetingState)state {
  NSLog(@"Meeting ready: %ld", (long)state);
}


-(void)startzoommeeting {
  MobileRTCMeetingService *meetingService = [[MobileRTC sharedRTC] getMeetingService];
  if (meetingService) {
    meetingService.delegate = self;
    [meetingService customizeMeetingTitle:@"Sample meeting title"];
    MobileRTCMeetingStartParam4WithoutLoginUser *user = [[MobileRTCMeetingStartParam4WithoutLoginUser alloc] init];
    user.userType = MobileRTCUserType_APIUser;
    user.meetingNumber = kMeetingNumber;
    user.userName = KuserName;
    user.isAppShare = NO;
    user.zak = @"MY_APP_JWT_TOKEN";
    [meetingService startMeetingWithStartParam: user];
  };
}
#pragma mark - MobileRTCAuthDelegate
- (void)onMobileRTCAuthReturn:(MobileRTCAuthError)returnValue {
    switch (returnValue) {
        case MobileRTCAuthError_Success:

[self startzoommeeting]; //  After the SDK initiation success 
            break;
      case MobileRTCAuthError_Unknown:
            NSLog(@"Client JWT Token authentication is invalid.");
            break;
        default:
            NSLog(@"SDK Authorization failed with MobileRTCAuthError: %u", returnValue);
    }
}

 

 

// ZoomViewController.h

#import <UIKit/UIKit.h>
#import <MobileRTC/MobileRTC.h>
#import <MobileCoreServices/MobileCoreServices.h>

@interface ViewController : UIViewController <MobileRTCMeetingServiceDelegate, MobileRTCAuthDelegate>
@end

 

// ZoomViewControllerBridge.m -- bridge_file


RCT_EXPORT_METHOD(presentZoomView) {
  dispatch_async(dispatch_get_main_queue(), ^{
    UIWindow *window = [[[UIApplication sharedApplication] windows] firstObject];
          if (window) {
            UIViewController *rootViewController = window.rootViewController;
            if ([rootViewController isKindOfClass:[UINavigationController class]]) {
                UINavigationController *navController = (UINavigationController *)rootViewController;
                ZoomViewController *zoomVC = [[ZoomViewController alloc] init];
                [navController pushViewController:zoomVC animated:YES];
          }
     });
}

 

In React Native , I'm calling the native code through bridge as below

 

import { NativeModules } from 'react-native';
const { ZoomViewControllerBridge } = NativeModules;
ZoomViewControllerBridge.presentZoomView();
 
The Zoom SDK initialization was successful, and the following line of code (meetingService startMeetingWithStartParam: user) was executed; however, nothing happens after that. When I try the same flow in native code, the delegate method (onMeetingStateChange) is called, but it's not getting called through the bridge.

 

What am I missing?

Humashankar
Partner
Feb 17, 2024 7:03 PM UTC

Hi - I hope that you are Doing good !!

Check the console output and any error messages you try to use the Zoom Meeting iOS SDK in your React Native project

Thank you very much and have a fantastic day!

3 replies

Humashankar
Partner
Partner
Feb 17, 2024 7:03 PM UTC

Hi - I hope that you are Doing good !!

Check the console output and any error messages you try to use the Zoom Meeting iOS SDK in your React Native project

Thank you very much and have a fantastic day!

Translate
PrabupAuthor
Explorer
Feb 19, 2024 5:32 AM UTC

Thank you for your response.

Translate
Humashankar
Partner
Partner
Feb 19, 2024 1:40 PM UTC

Great to know !!

Translate