Description
My approach was to design a User interface that collects Username and Meeting No. I have written some lines to Initialize SDK, Authenticate and parse params to join meeting but nothing seems to work when I tap join meeting. Please help.
Which version?
5.0.24433.0616
Smartphone (please complete the following information):
Xcode Simulator
Additional context
This is what my code looks like:
MyAppController.h
//
// MyAppController.h
#import <UIKit/UIKit.h>
#define kSDKDomain @ “zoom.us”
NS_ASSUME_NONNULL_BEGIN
@interface MyAppController : UIViewController
//- (void)joinMeeting:ViewControllerNo withUsername:(NSString*)meetingUser;
@property ( weak , nonatomic ) IBOutlet UITextField *MeetingNumber;
//@property (weak, nonatomic) IBOutlet UITextField *MeetingName;
@property ( weak , nonatomic ) IBOutlet UITextField *Username;
//@property (weak, nonatomic) IBOutlet UIButton *BackToFrontNavigation;
@end
NS_ASSUME_NONNULL_END
MyAppController.m
//
// MyAppController.m
//
#import “MyAppController.h”
#import “MobileRTC/MobileRTC.h”
#import “Universal-Swift.h”
#define kSDKDomain @ “zoom.us”
#define KjwtToken @ “”
#define zoomclientKey @ “Gkz*********************************************”
#define zoomclientSecret @ “gxZ*********************************************”
@interface MyAppController ()
@end
@implementation MyAppController
-
(void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.MeetingNumber.borderStyle = UITextBorderStyleRoundedRect;
self.Username.borderStyle = UITextBorderStyleRoundedRect;[[UIDevice currentDevice] setValue:[NSNumber numberWithInt:UIDeviceOrientationPortrait] forKey:@“orientation”];
//1. initSDK
// [MobileRTC initializeWithDomain:kSDKDomain enableLog:YES];
// [[MobileRTC sharedRTC] setMobileRTCDomain:kSDKDomain];MobileRTCSDKInitContext *context = [[MobileRTCSDKInitContext alloc] init]; context.domain = kSDKDomain; context.enableLog = YES; context.locale = MobileRTC_ZoomLocale_Default;
}
- (void)SDKAuth
{
MobileRTCAuthService *authService = [[MobileRTC sharedRTC] getAuthService];
if (authService)
{
authService.delegate = self;
authService.clientKey = zoomclientKey;
authService.clientSecret = zoomclientSecret;
// Here need add your jwtToken, if jwtToken is nil or empty,We will user your clientKey and clientSecret to Auth, We recommend using JWTToken.
authService.jwtToken = KjwtToken;
[authService sdkAuth];
}
}
//- (IBAction)backToFrontNavigationBtnTouched:(id)sender {
//FrontNavigationController *obj =[[FrontNavigationController alloc] init];
//use this to go back home
//[self.navigationController popToRootViewControllerAnimated:YES];
//MyAppController *myzoomstart = [MyAppController alloc];
//UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:myzoomstart];
//nav.modalPresentationStyle = UIModalPresentationFormSheet;
//[self presentViewController:nav animated:YES completion:NULL];
//[self.MyAppController pushViewController:obj animated:YES];
//back button code in here
//UIStoryboard *story = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
//MyAppController *secondViewController = [story instantiateViewControllerWithIdentifier:@"SWRevealViewController"];
//secondViewController.modalPresentationStyle = UIModalPresentationOverFullScreen;
//secondViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
//[self presentViewController:secondViewController animated:YES completion:nil];
//}
-
(IBAction)onJoinMeetingBtnTouched:(id)sender {
// Step 1: get meeting number and Username
NSString *meetingUser = self.Username.text;
NSString *meetingNo = self.MeetingNumber.text;
NSLog(@“Meeting Number is: %@”, meetingNo);
//NSLog(@“Meeting Password is:%@”,pwd);
// Step 2: Hide key board on clicking the button.
[self.MeetingNumber endEditing:YES];
//[self.MeetingPassword endEditing:YES];
// Step 3: Call joinMeeting method.
if ([meetingNo length]) {
[self joinMeeting:meetingNo withUsername:(NSString *)meetingUser];
}
} -
(void)joinMeeting:(NSString*)meetingNo withUsername:(NSString*)meetingUser{
NSLog(@“meetingNO: %@”, meetingNo);
if(![meetingNo length]) {
// If the meeting number is empty, return error.
NSLog(@“Please enter a meeting number”);
return;
} else {
// If the meeting number is not empty.
MobileRTCMeetingService *service = [[MobileRTC sharedRTC] getMeetingService];
if (service) {
service.delegate = self;
// initialize a parameter dictionary to store parameters.
NSDictionary *paramDict = @{
kMeetingParam_Username: meetingUser,
kMeetingParam_MeetingNumber: meetingNo,
//kMeetingParam_MeetingPassword: pwd,
};
MobileRTCMeetError response = [service joinMeetingWithDictionary:paramDict];
NSLog(@“onJoinMeeting, response: %d”, response);
}
}
}
-(BOOL) shouldAutorotate{
return NO;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end