Skip to content

Commit 77b1a8c

Browse files
committed
Merge remote-tracking branch 'easemob/main' into du_dev
2 parents 79c4f6e + 50dc29f commit 77b1a8c

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

Classes/Process/EaseCallManager.m

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ - (void)startInviteUsers:(NSArray<NSString*>*)aUsers ext:(NSDictionary*)aExt co
156156
if(weakself.modal.currentCall && weakself.callVC) {
157157
NSLog(@"inviteUsers in group");
158158
for(NSString* uId in aUsers) {
159-
if([weakself.modal.currentCall.allUserAccounts.allKeys containsObject:uId])
159+
if([weakself.modal.currentCall.allUserAccounts.allValues containsObject:uId])
160160
continue;
161161
[weakself sendInviteMsgToCallee:uId type:weakself.modal.currentCall.callType callId:weakself.modal.currentCall.callId channelName:weakself.modal.currentCall.channelName ext:aExt completion:nil];
162162
[weakself _startCallTimer:uId];
@@ -296,6 +296,28 @@ - (void)clearRes
296296
self.bNeedSwitchToVoice = NO;
297297
}
298298

299+
-(UIWindow*) getKeyWindow
300+
{
301+
if(@available(iOS 13.0, *)) {
302+
for(UIWindowScene* scene in [UIApplication sharedApplication].connectedScenes) {
303+
if(scene.activationState == UISceneActivationStateForegroundActive) {
304+
if(@available(iOS 15.0, *)) {
305+
return scene.keyWindow;
306+
}else{
307+
for(UIWindow* window in scene.windows) {
308+
if(window.isKeyWindow) {
309+
return window;
310+
}
311+
}
312+
}
313+
}
314+
}
315+
}else{
316+
return [UIApplication sharedApplication].keyWindow;
317+
}
318+
return nil;
319+
}
320+
299321
- (void)refreshUIOutgoing
300322
{
301323
if(self.modal.currentCall) {
@@ -304,7 +326,10 @@ - (void)refreshUIOutgoing
304326
self.callVC = [[EaseCallSingleViewController alloc] initWithisCaller:self.modal.currentCall.isCaller type:self.modal.currentCall.callType remoteName:self.modal.currentCall.remoteUserAccount];
305327
self.callVC.modalPresentationStyle = UIModalPresentationFullScreen;
306328
__weak typeof(self) weakself = self;
307-
UIViewController* rootVC = [[UIApplication sharedApplication].delegate window].rootViewController;
329+
UIWindow* keyWindow = [self getKeyWindow];
330+
if(!keyWindow)
331+
return;
332+
UIViewController* rootVC = keyWindow.rootViewController;
308333
[rootVC presentViewController:self.callVC animated:NO completion:^{
309334
if(weakself.modal.currentCall.callType == EaseCallType1v1Video)
310335
[weakself setupLocalVideo];
@@ -319,7 +344,10 @@ - (void)refreshUIAnswering
319344
if(self.modal.currentCall.callType == EaseCallTypeMulti && self.modal.currentCall.isCaller) {
320345
self.callVC = [[EaseCallMultiViewController alloc] init];
321346
self.callVC.modalPresentationStyle = UIModalPresentationFullScreen;
322-
UIViewController* rootVC = [[UIApplication sharedApplication].delegate window].rootViewController;
347+
UIWindow* keyWindow = [self getKeyWindow];
348+
if(!keyWindow)
349+
return;
350+
UIViewController* rootVC = keyWindow.rootViewController;
323351
__weak typeof(self) weakself = self;
324352
[rootVC presentViewController:self.callVC animated:NO completion:^{
325353
[weakself setupLocalVideo];
@@ -342,7 +370,10 @@ - (void)refreshUIAlerting
342370
self.callVC = [[EaseCallMultiViewController alloc] init];
343371
[self getMultiVC].inviterId = self.modal.currentCall.remoteUserAccount;
344372
self.callVC.modalPresentationStyle = UIModalPresentationFullScreen;
345-
UIViewController* rootVC = [[UIApplication sharedApplication].delegate window].rootViewController;
373+
UIWindow* keyWindow = [self getKeyWindow];
374+
if(!keyWindow)
375+
return;
376+
UIViewController* rootVC = keyWindow.rootViewController;
346377
if(rootVC.presentationController && rootVC.presentationController.presentedViewController)
347378
[rootVC.presentationController.presentedViewController dismissViewControllerAnimated:NO completion:nil];
348379

@@ -1339,4 +1370,5 @@ - (void)sendVideoToVoiceMsg
13391370
{
13401371
[self sendVideoToVoiceMsg:self.modal.currentCall.remoteUserAccount callId:self.modal.currentCall.callId];
13411372
}
1373+
13421374
@end

Classes/Store/EaseCallConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
5555
* encoderConfiguration 声网RTC Video配置
5656
*/
5757
@property (nonatomic,strong) AgoraVideoEncoderConfiguration *encoderConfiguration;
58-
@property (nonatomic) NSUInteger* agoraUid;
58+
@property (nonatomic) NSUInteger agoraUid;
5959

6060
- (void)setUser:(NSString*)aUser info:(EaseCallUser*)aInfo;
6161
@end

0 commit comments

Comments
 (0)