Resolved! 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 [self startzoommeeting]; // After the SDK initiation success // ZoomViewController.h #import <UIKit/UIKit.h> // ZoomViewControllerBridge.m -- bridge_file In React Native , I'm calling the native code through bridge as below What am I missing?
- (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:
break;
case MobileRTCAuthError_Unknown:
NSLog(@"Client JWT Token authentication is invalid.");
break;
default:
NSLog(@"SDK Authorization failed with MobileRTCAuthError: %u", returnValue);
}
}
#import <MobileRTC/MobileRTC.h>
#import <MobileCoreServices/MobileCoreServices.h>
@interface ViewController : UIViewController <MobileRTCMeetingServiceDelegate, MobileRTCAuthDelegate>
@end
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];
}
});
}
Show less