Skip to content

Commit

Permalink
iOS 3.16.1 更新 (#221)
Browse files Browse the repository at this point in the history
* fix: 3.10.0 demoC

* fix: iOS demo

* fix: demo 优化

* fix: NEMeetingKit iOS 3.14.0

* fix: storyboard ui

* fix: code format

---------

Co-authored-by: zhouxiaolu <[email protected]>
  • Loading branch information
Topredator and zhouxiaolu authored Nov 3, 2023
1 parent a6045f2 commit a85db48
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 94 deletions.
27 changes: 19 additions & 8 deletions SampleCode/iOS/NEMeetingDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
41FE2B9124AD8F5800624342 /* SystemAuthHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SystemAuthHelper.m; sourceTree = "<group>"; };
5354C499286EEDDB000F5193 /* NSEditSubscribeMeetingVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSEditSubscribeMeetingVC.m; sourceTree = "<group>"; };
5354C49A286EEDDB000F5193 /* NSEditSubscribeMeetingVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSEditSubscribeMeetingVC.h; sourceTree = "<group>"; };
537437482ADFD7110058ECBB /* MeetingConfigEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MeetingConfigEnum.h; sourceTree = "<group>"; };
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 = "<group>"; };
9E451CEF25B041BF00E69CDE /* MeetingMenuSelectVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MeetingMenuSelectVC.h; sourceTree = "<group>"; };
9E451CF025B041BF00E69CDE /* MeetingMenuSelectVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MeetingMenuSelectVC.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -266,6 +267,7 @@
410B434224AC665600017FA6 /* Section */ = {
isa = PBXGroup;
children = (
537437482ADFD7110058ECBB /* MeetingConfigEnum.h */,
41E9117825010E6900E63D80 /* CustomViewController.h */,
41E9117925010E6900E63D80 /* CustomViewController.m */,
410B431B24AB295B00017FA6 /* EnterMeetingVC.h */,
Expand Down Expand Up @@ -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)",
Expand All @@ -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;
};
Expand All @@ -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)",
Expand All @@ -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;
};
Expand Down Expand Up @@ -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)",
Expand All @@ -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;
};
Expand Down
14 changes: 13 additions & 1 deletion SampleCode/iOS/NEMeetingDemo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-191.30434782608697" y="119.86607142857142"/>
<point key="canvasLocation" x="-29" y="96"/>
</scene>
<!--网易会议Demo-->
<scene sceneID="K1h-Jj-JLh">
Expand Down Expand Up @@ -643,6 +643,17 @@
<action selector="onLeaveCurrentMeeting:" destination="chG-oq-e3a" eventType="touchUpInside" id="46E-kl-MGL"/>
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="媒体流加密密钥" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="lI8-td-lfP">
<rect key="frame" x="16" y="731" width="382" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Eju-Sw-TxT">
<rect key="frame" x="16" y="765" width="382" height="1"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="Ks5-zp-udT"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
Expand All @@ -660,6 +671,7 @@
<navigationItem key="navigationItem" title="网易会议" id="6xJ-VD-2cX"/>
<connections>
<outlet property="configCheckBox" destination="peJ-8z-lnX" id="DUM-Rw-k47"/>
<outlet property="encryptionKeyInput" destination="lI8-td-lfP" id="ZYM-PV-JX8"/>
<outlet property="enterBtn" destination="Wbf-5g-AtC" id="Epk-8k-PO1"/>
<outlet property="meetingIdInput" destination="hUm-RV-4u6" id="f88-Y3-893"/>
<outlet property="nickInput" destination="IHf-Fa-kfF" id="aeH-Dq-6TT"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ - (void)showErrorCode:(NSInteger)code msg:(NSString *)msg {


- (BOOL)shouldAutorotate {
return NO;
return YES;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}

@end
11 changes: 9 additions & 2 deletions SampleCode/iOS/NEMeetingDemo/Section/EnterMeetingVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ @interface EnterMeetingVC ()<CheckBoxDelegate, MeetingServiceListener,MeetingMen

@property (weak, nonatomic) IBOutlet CheckBox *configCheckBox;
@property (weak, nonatomic) IBOutlet CheckBox *settingCheckBox;

@property (weak, nonatomic) IBOutlet UITextField *meetingIdInput;
@property (weak, nonatomic) IBOutlet UITextField *nickInput;
@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@property (weak, nonatomic) IBOutlet UIButton *enterBtn;
@property (weak, nonatomic) IBOutlet UITextField *passworkInput;
@property (weak, nonatomic) IBOutlet UITextField *tagInput;
@property (strong, nonatomic) IBOutlet UITextField *encryptionKeyInput;
@property (nonatomic, strong) NSArray <NEMeetingMenuItem *> *fullToolbarMenuItems;
@property (nonatomic, strong) NSArray <NEMeetingMenuItem *> *fullMoreMenuItems;
// 自定义菜单类型:toolbar/更多
Expand Down Expand Up @@ -60,7 +60,7 @@ - (void)setupUI {
@"隐藏Sip菜单", @"显示用户角色标签", @"显示会议结束提醒", @"聊天室文件消息",
@"聊天室图片消息", @"开启静音检测", @"关闭静音包", @"显示屏幕共享者画面",
@"显示白板共享者画面", @"设置白板透明", @"前置摄像头镜像", @"显示麦克风浮窗",
@"入会时隐藏直播菜单", @"开启音频共享"
@"入会时隐藏直播菜单", @"开启音频共享", @"开启加密"
]];
_settingCheckBox.delegate = self;
[self.settingCheckBox setItemSelected:YES index:MeetingSettingTypeChatroomEnableFile];
Expand Down Expand Up @@ -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]) {
Expand Down
86 changes: 9 additions & 77 deletions SampleCode/iOS/NEMeetingDemo/Section/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
#import "MeetingSettingVC.h"

@interface MainViewController ()<MeetingServiceListener>

@property (nonatomic, strong) UIButton *mulIMBtn;
@property (nonatomic, strong) TimerButton *restoreMeetingBtn;
@property (nonatomic, strong) UIViewController *preVC;
@property (nonatomic, strong) UIAlertController *alert;
@end
Expand All @@ -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];
Expand All @@ -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];
Expand All @@ -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 {
Expand Down Expand Up @@ -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) {
Expand All @@ -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";
Expand Down Expand Up @@ -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
6 changes: 4 additions & 2 deletions SampleCode/iOS/NEMeetingDemo/Section/MeetingConfigEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ typedef NS_ENUM(NSInteger, MeetingSettingType) {
MeetingSettingTypeEnableFrontCameraMirror,
MeetingSettingTypeShowFloatingMicrophone,
MeetingSettingTypeJoinOffLive,
MeetingSettingTypeEnabeAudioShare
MeetingSettingTypeEnabeAudioShare,
MeetingSettingTypeEnableEncryption
};

/// 创建会议设置选项类型
Expand Down Expand Up @@ -75,7 +76,8 @@ typedef NS_ENUM(NSInteger, CreateMeetingSettingType) {
CreateMeetingSettingTypeEnableFrontCameraMirror,
CreateMeetingSettingTypeShowFloatingMicrophone,
CreateMeetingSettingTypeJoinOffLive,
CreateMeetingSettingTypeEnabeAudioShare
CreateMeetingSettingTypeEnabeAudioShare,
CreateMeetingSettingTypeEnableEncryption
};

#endif /* MeetingConfigEnum_h */
11 changes: 10 additions & 1 deletion SampleCode/iOS/NEMeetingDemo/Section/StartMeetingVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ @interface StartMeetingVC () <CheckBoxDelegate, MeetingMenuSelectVCDelegate, Mee
@property(weak, nonatomic) IBOutlet UITextField *passwordInput;
/// 会议主题输入框
@property(weak, nonatomic) IBOutlet UITextField *subjectInput;
@property (strong, nonatomic) IBOutlet UITextField *encryptionKeyInput;

@property(nonatomic, copy) NSString *meetingNum;
@property(nonatomic, assign) BOOL audioOffAllowSelfOn;
Expand Down Expand Up @@ -82,7 +83,8 @@ - (void)setupUI {
@"显示会议结束提醒", @"聊天室文件消息", @"聊天室图片消息",
@"开启静音检测", @"关闭静音包", @"显示屏幕共享者画面",
@"显示白板共享者画面", @"设置白板透明", @"前置摄像头镜像",
@"显示麦克风浮窗", @"入会时隐藏直播菜单", @"开启音频共享"
@"显示麦克风浮窗", @"入会时隐藏直播菜单", @"开启音频共享",
@"开启加密"
]];
_settingCheckBox.delegate = self;
[self.settingCheckBox setItemSelected:YES index:CreateMeetingSettingTypeChatroomEnableFile];
Expand Down Expand Up @@ -131,6 +133,13 @@ - (void)doStartMeeting {
params.extraData = _extraInput.text.length ? _extraInput.text : nil;
// 会议主题
params.subject = _subjectInput.text;
// 是否开启媒体流加密
if ([self selectedSetting:CreateMeetingSettingTypeEnableEncryption]) {
NEEncryptionConfig *encryptionConfig = [[NEEncryptionConfig alloc] init];
encryptionConfig.encryptionMode = GMCryptoSM4ECB;
encryptionConfig.encryptKey = _encryptionKeyInput.text;
params.encryptionConfig = encryptionConfig;
}
// 联席主持人配置
if (_coHostInput.text.length) {
NSString *cohostText = _coHostInput.text;
Expand Down
Loading

0 comments on commit a85db48

Please sign in to comment.