diff --git a/SampleCode/iOS/NEMeetingDemo.xcodeproj/project.pbxproj b/SampleCode/iOS/NEMeetingDemo.xcodeproj/project.pbxproj index 797bbc25..5174739d 100644 --- a/SampleCode/iOS/NEMeetingDemo.xcodeproj/project.pbxproj +++ b/SampleCode/iOS/NEMeetingDemo.xcodeproj/project.pbxproj @@ -214,6 +214,7 @@ 41FE2B9124AD8F5800624342 /* SystemAuthHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SystemAuthHelper.m; sourceTree = ""; }; 5354C499286EEDDB000F5193 /* NSEditSubscribeMeetingVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSEditSubscribeMeetingVC.m; sourceTree = ""; }; 5354C49A286EEDDB000F5193 /* NSEditSubscribeMeetingVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSEditSubscribeMeetingVC.h; sourceTree = ""; }; + 537437482ADFD7110058ECBB /* MeetingConfigEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MeetingConfigEnum.h; sourceTree = ""; }; 7F47C73E59370BEEAE7064C7 /* Pods-NEMeetingDemo-Broadcaster.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NEMeetingDemo-Broadcaster.debug.xcconfig"; path = "Target Support Files/Pods-NEMeetingDemo-Broadcaster/Pods-NEMeetingDemo-Broadcaster.debug.xcconfig"; sourceTree = ""; }; 9E451CEF25B041BF00E69CDE /* MeetingMenuSelectVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MeetingMenuSelectVC.h; sourceTree = ""; }; 9E451CF025B041BF00E69CDE /* MeetingMenuSelectVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MeetingMenuSelectVC.m; sourceTree = ""; }; @@ -266,6 +267,7 @@ 410B434224AC665600017FA6 /* Section */ = { isa = PBXGroup; children = ( + 537437482ADFD7110058ECBB /* MeetingConfigEnum.h */, 41E9117825010E6900E63D80 /* CustomViewController.h */, 41E9117925010E6900E63D80 /* CustomViewController.m */, 410B431B24AB295B00017FA6 /* EnterMeetingVC.h */, @@ -898,9 +900,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = NEMeetingDemo/NEMeetingDemo.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 11000; - DEVELOPMENT_TEAM = 569GNZ5392; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7C9A6NRV5L; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -917,9 +921,10 @@ ); MARKETING_VERSION = 3.0.0; ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.netease.meetinglib.sdk.NEMeetingDemo; + PRODUCT_BUNDLE_IDENTIFIER = com.netease.yunxin.meeting.hawk; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Meeting_Dev; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_WORKSPACE = NO; }; @@ -932,9 +937,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = NEMeetingDemo/NEMeetingDemo.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 11000; - DEVELOPMENT_TEAM = 569GNZ5392; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7C9A6NRV5L; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -948,9 +955,10 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 3.0.0; - PRODUCT_BUNDLE_IDENTIFIER = com.netease.meetinglib.sdk.NEMeetingDemo; + PRODUCT_BUNDLE_IDENTIFIER = com.netease.yunxin.meeting.hawk; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Meeting_Dev; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_WORKSPACE = NO; }; @@ -1021,9 +1029,11 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = NEMeetingDemo/NEMeetingDemo.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 11000; DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 7C9A6NRV5L; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1037,9 +1047,10 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 3.0.0; - PRODUCT_BUNDLE_IDENTIFIER = com.netease.meetinglib.sdk.NEMeetingDemo; + PRODUCT_BUNDLE_IDENTIFIER = com.netease.yunxin.meeting.hawk; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Meeting_Dev; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_WORKSPACE = NO; }; diff --git a/SampleCode/iOS/NEMeetingDemo/Base.lproj/Main.storyboard b/SampleCode/iOS/NEMeetingDemo/Base.lproj/Main.storyboard index a0afe58d..d96828d3 100644 --- a/SampleCode/iOS/NEMeetingDemo/Base.lproj/Main.storyboard +++ b/SampleCode/iOS/NEMeetingDemo/Base.lproj/Main.storyboard @@ -119,7 +119,7 @@ - + @@ -643,6 +643,17 @@ + + + + + + + + + + + @@ -660,6 +671,7 @@ + diff --git a/SampleCode/iOS/NEMeetingDemo/Common/ViewController/BaseViewController.m b/SampleCode/iOS/NEMeetingDemo/Common/ViewController/BaseViewController.m index cefbe225..5ee6df18 100644 --- a/SampleCode/iOS/NEMeetingDemo/Common/ViewController/BaseViewController.m +++ b/SampleCode/iOS/NEMeetingDemo/Common/ViewController/BaseViewController.m @@ -50,7 +50,9 @@ - (void)showErrorCode:(NSInteger)code msg:(NSString *)msg { - (BOOL)shouldAutorotate { - return NO; + return YES; +} +- (UIInterfaceOrientationMask)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskAll; } - @end diff --git a/SampleCode/iOS/NEMeetingDemo/Section/EnterMeetingVC.m b/SampleCode/iOS/NEMeetingDemo/Section/EnterMeetingVC.m index 3bbc18e3..e3f553ec 100644 --- a/SampleCode/iOS/NEMeetingDemo/Section/EnterMeetingVC.m +++ b/SampleCode/iOS/NEMeetingDemo/Section/EnterMeetingVC.m @@ -18,13 +18,13 @@ @interface EnterMeetingVC () *fullToolbarMenuItems; @property (nonatomic, strong) NSArray *fullMoreMenuItems; // 自定义菜单类型:toolbar/更多 @@ -60,7 +60,7 @@ - (void)setupUI { @"隐藏Sip菜单", @"显示用户角色标签", @"显示会议结束提醒", @"聊天室文件消息", @"聊天室图片消息", @"开启静音检测", @"关闭静音包", @"显示屏幕共享者画面", @"显示白板共享者画面", @"设置白板透明", @"前置摄像头镜像", @"显示麦克风浮窗", - @"入会时隐藏直播菜单", @"开启音频共享" + @"入会时隐藏直播菜单", @"开启音频共享", @"开启加密" ]]; _settingCheckBox.delegate = self; [self.settingCheckBox setItemSelected:YES index:MeetingSettingTypeChatroomEnableFile]; @@ -91,6 +91,13 @@ - (IBAction)onEnterMeetingAction:(id)sender { params.password = _passworkInput.text; params.tag = _tagInput.text; + // 是否开启媒体流加密 + if ([self selectedSetting:MeetingSettingTypeEnableEncryption]) { + NEEncryptionConfig *encryptionConfig = [[NEEncryptionConfig alloc] init]; + encryptionConfig.encryptionMode = GMCryptoSM4ECB; + encryptionConfig.encryptKey = _encryptionKeyInput.text; + params.encryptionConfig = encryptionConfig; + } NEJoinMeetingOptions *options = [[NEJoinMeetingOptions alloc] init]; // 默认会议配置 if (![self selectedSetting:MeetingSettingTypeDefaultSetting]) { diff --git a/SampleCode/iOS/NEMeetingDemo/Section/MainViewController.m b/SampleCode/iOS/NEMeetingDemo/Section/MainViewController.m index 8630f4f6..bb602a96 100644 --- a/SampleCode/iOS/NEMeetingDemo/Section/MainViewController.m +++ b/SampleCode/iOS/NEMeetingDemo/Section/MainViewController.m @@ -13,9 +13,7 @@ #import "MeetingSettingVC.h" @interface MainViewController () - @property (nonatomic, strong) UIButton *mulIMBtn; -@property (nonatomic, strong) TimerButton *restoreMeetingBtn; @property (nonatomic, strong) UIViewController *preVC; @property (nonatomic, strong) UIAlertController *alert; @end @@ -31,16 +29,6 @@ - (void)viewDidLoad { object:nil]; } -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - - if (@available(iOS 11.0, *)) { - _restoreMeetingBtn.frame = CGRectMake(0, self.view.safeAreaInsets.top, self.view.width, 20); - } else { - _restoreMeetingBtn.frame = CGRectMake(0, 64, self.view.width, 20); - } -} - - (void)onMeetingInitAction:(NSNotification *)note { [[NEMeetingKit getInstance].getMeetingService addListener:self]; [self autoLogin]; @@ -65,13 +53,6 @@ - (void)onEnterMulAction:(UIButton *)sender { [self.navigationController pushViewController:vc animated:YES]; } -- (void)onRestoreMeetingAction:(UIButton *)sender { - BOOL ret = [[NEMeetingKit getInstance].getMeetingService returnToMeeting]; - if (ret) { - sender.hidden = YES; - } -} - - (IBAction)onAppSettings:(id)sender { AppSettingsVC *vc = [[AppSettingsVC alloc] init]; [self.navigationController pushViewController:vc animated:YES]; @@ -98,7 +79,6 @@ - (void)setupUI { #endif UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:self.mulIMBtn]; self.navigationItem.rightBarButtonItem = item; - [[UIApplication sharedApplication].keyWindow addSubview:self.restoreMeetingBtn]; } - (UIButton *)mulIMBtn { @@ -150,23 +130,7 @@ - (void)onInjectedMenuItemClick:(NEMenuClickInfo *)clickInfo if (clickInfo.itemId == 100) { } else if (clickInfo.itemId == 111) { [NEMeetingKit.getInstance.getMeetingService - minimizeCurrentMeeting:^(NSInteger resultCode, NSString *resultMsg, id resultData) { - if (resultCode == 0) { - [NEMeetingKit.getInstance.getMeetingService - getCurrentMeetingInfo:^(NSInteger resultCode, NSString *_Nonnull resultMsg, - NEMeetingInfo *_Nonnull info) { - if (!info) { - NSLog(@"meetingNum: %@ meetingId: %llu", info.meetingNum, info.meetingId); - self.restoreMeetingBtn.neTitle = info.subject; - int64_t interval = info.duration / 1000; - if (interval > 0) { - self.restoreMeetingBtn.startTime = interval; - } - self.restoreMeetingBtn.hidden = NO; - } - }]; - } - }]; + minimizeCurrentMeeting:^(NSInteger resultCode, NSString *resultMsg, id resultData) {}]; } else { _alert = [UIAlertController alertControllerWithTitle:@"" message:[NSString stringWithFormat:@"%@-%@",clickInfo,meetingInfo] preferredStyle:UIAlertControllerStyleAlert]; [_alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { @@ -184,41 +148,19 @@ - (void)onInjectedMenuItemClick:(NEMenuClickInfo *)clickInfo [_preVC presentViewController:_alert animated:YES completion:nil]; } } -- (void)updateMeetingBtnWithInfo:(NEMeetingInfo *)info { - NEMeetingStatus status = [[NEMeetingKit getInstance] getMeetingService].getMeetingStatus; - if (status != MEETING_STATUS_INMEETING_MINIMIZED) return; - - NSLog(@"meetingNum: %@ meetingId: %llu", info.meetingNum, info.meetingId); - _restoreMeetingBtn.neTitle = info.subject; - int64_t interval = info.duration/1000; - if (interval > 0) { - _restoreMeetingBtn.startTime = interval; - } - _restoreMeetingBtn.hidden = NO; -} - (void)onMeetingStatusChanged:(NEMeetingEvent *)event { - if (event.status == MEETING_STATUS_INMEETING_MINIMIZED) { - __weak typeof(self) weakSelf = self; - [[[NEMeetingKit getInstance] getMeetingService] getCurrentMeetingInfo:^(NSInteger resultCode, NSString * _Nonnull resultMsg, NEMeetingInfo * _Nonnull info) { - if (info) { - [weakSelf updateMeetingBtnWithInfo:info]; - } - }]; - }else{ - if(event.status == MEETING_STATUS_DISCONNECTING && _preVC != nil){ - [_preVC dismissViewControllerAnimated:YES completion:nil]; - } - _restoreMeetingBtn.hidden = YES; - - if(event.status == MEETING_STATUS_DISCONNECTING){ - NSString *toastString = [NSString stringWithFormat:@"onMeetingDisconnected: %@", [self stringifyDisconnectedReason: event.arg]]; - [[UIApplication sharedApplication].keyWindow makeToast:toastString duration:2 position:CSToastPositionCenter]; - } + if (event.status == MEETING_STATUS_DISCONNECTING && _preVC != nil) { + [_preVC dismissViewControllerAnimated:YES completion:nil]; + } + + if (event.status == MEETING_STATUS_DISCONNECTING) { + NSString *toastString = [NSString stringWithFormat:@"onMeetingDisconnected: %@", [self stringifyDisconnectedReason: event.arg]]; + [[UIApplication sharedApplication].keyWindow makeToast:toastString duration:2 position:CSToastPositionCenter]; } } -- (NSString *) stringifyDisconnectedReason:(NSInteger)disconnectCode { +- (NSString *)stringifyDisconnectedReason:(NSInteger)disconnectCode { switch (disconnectCode) { case MEETING_DISCONNECTING_BY_HOST: return @"remove_by_host"; @@ -249,15 +191,5 @@ - (NSString *) stringifyDisconnectedReason:(NSInteger)disconnectCode { } } -- (UIButton *)restoreMeetingBtn { - if (!_restoreMeetingBtn) { - _restoreMeetingBtn = [TimerButton buttonWithType:UIButtonTypeCustom]; - _restoreMeetingBtn.hidden = YES; - [_restoreMeetingBtn addTarget:self - action:@selector(onRestoreMeetingAction:) - forControlEvents:UIControlEventTouchUpInside]; - } - return _restoreMeetingBtn; -} @end diff --git a/SampleCode/iOS/NEMeetingDemo/Section/MeetingConfigEnum.h b/SampleCode/iOS/NEMeetingDemo/Section/MeetingConfigEnum.h index 38567b81..70240b52 100644 --- a/SampleCode/iOS/NEMeetingDemo/Section/MeetingConfigEnum.h +++ b/SampleCode/iOS/NEMeetingDemo/Section/MeetingConfigEnum.h @@ -39,7 +39,8 @@ typedef NS_ENUM(NSInteger, MeetingSettingType) { MeetingSettingTypeEnableFrontCameraMirror, MeetingSettingTypeShowFloatingMicrophone, MeetingSettingTypeJoinOffLive, - MeetingSettingTypeEnabeAudioShare + MeetingSettingTypeEnabeAudioShare, + MeetingSettingTypeEnableEncryption }; /// 创建会议设置选项类型 @@ -75,7 +76,8 @@ typedef NS_ENUM(NSInteger, CreateMeetingSettingType) { CreateMeetingSettingTypeEnableFrontCameraMirror, CreateMeetingSettingTypeShowFloatingMicrophone, CreateMeetingSettingTypeJoinOffLive, - CreateMeetingSettingTypeEnabeAudioShare + CreateMeetingSettingTypeEnabeAudioShare, + CreateMeetingSettingTypeEnableEncryption }; #endif /* MeetingConfigEnum_h */ diff --git a/SampleCode/iOS/NEMeetingDemo/Section/StartMeetingVC.m b/SampleCode/iOS/NEMeetingDemo/Section/StartMeetingVC.m index 5fffb206..19cca121 100644 --- a/SampleCode/iOS/NEMeetingDemo/Section/StartMeetingVC.m +++ b/SampleCode/iOS/NEMeetingDemo/Section/StartMeetingVC.m @@ -35,6 +35,7 @@ @interface StartMeetingVC () + @@ -155,6 +156,21 @@ + + + + + + + + + + + + + + + @@ -165,6 +181,7 @@ + @@ -182,12 +199,15 @@ + + + @@ -198,6 +218,7 @@ + @@ -210,6 +231,7 @@ + diff --git a/SampleCode/iOS/Podfile b/SampleCode/iOS/Podfile index aa5caec1..f421993a 100644 --- a/SampleCode/iOS/Podfile +++ b/SampleCode/iOS/Podfile @@ -12,6 +12,6 @@ target 'NEMeetingDemo' do pod 'Masonry', '~> 1.1.0' pod 'Reachability' - pod 'NEMeetingKit', '~> 3.15.0' + pod 'NEMeetingKit', '~> 3.16.1' end