Skip to content

Commit

Permalink
Release RongCloud CallKit SDK 2.8.16
Browse files Browse the repository at this point in the history
  • Loading branch information
RongRobot committed Aug 24, 2017
1 parent f1c7afb commit fd58135
Show file tree
Hide file tree
Showing 37 changed files with 426 additions and 2,327 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class RCDAudioFrameObserver : public agora::media::IAudioFrameObserver {
static RCDAudioFrameObserver *sharedObserver();
bool onRecordAudioFrame(agora::media::IAudioFrameObserver::AudioFrame& audioFrame);
bool onPlaybackAudioFrame(agora::media::IAudioFrameObserver::AudioFrame& audioFrame);
bool onMixedAudioFrame(agora::media::IAudioFrameObserver::AudioFrame &audioFrame);
bool onPlaybackAudioFrameBeforeMixing(unsigned int uid, agora::media::IAudioFrameObserver::AudioFrame& audioFrame);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
return &sharedObserver;
}


bool RCDAudioFrameObserver::onRecordAudioFrame(agora::media::IAudioFrameObserver::AudioFrame& audioFrame) {
return true;
}
bool RCDAudioFrameObserver::onPlaybackAudioFrame(agora::media::IAudioFrameObserver::AudioFrame& audioFrame) {
return true;
}
bool RCDAudioFrameObserver::onMixedAudioFrame(agora::media::IAudioFrameObserver::AudioFrame &audioFrame) {
return true;
}
bool RCDAudioFrameObserver::onPlaybackAudioFrameBeforeMixing(unsigned int uid, agora::media::IAudioFrameObserver::AudioFrame& audioFrame) {
NSString *userId = rcGetUserIdFromAgoraUID(uid);
NSLog(@"the user id is %@", userId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,22 @@ - (void)initAllUserModel {
self.mainModel = [self generateUserModel:self.callSession.inviter];

self.subUserModelList = [[NSMutableArray alloc] init];
BOOL isContaitSelf = NO;
for (RCCallUserProfile *userProfile in self.callSession.userProfileList) {
if (![userProfile.userId isEqualToString:self.callSession.inviter]) {
RCCallUserCallInfoModel *userModel =
[self generateUserModel:userProfile.userId];
[self.subUserModelList addObject:userModel];
}
if ([userProfile.userId isEqualToString:currentUserId]) {
isContaitSelf = YES;
}
}
if (!isContaitSelf) {
RCCallUserCallInfoModel *userModel =
[self generateUserModel:currentUserId];
[self.subUserModelList addObject:userModel];
}
RCCallUserCallInfoModel *userModel =
[self generateUserModel:currentUserId];
[self.subUserModelList addObject:userModel];
}
} else if (self.callSession.callStatus == RCCallDialing) {
self.mainModel = [self generateUserModel:currentUserId];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ - (void)viewDidLoad {
object:nil];

[self registerTelephonyEvent];
[self addProximityMonitoringObserver];

// UIVisualEffect *blurEffect = [UIBlurEffect
// effectWithStyle:UIBlurEffectStyleDark];
// self.blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
Expand Down Expand Up @@ -1134,7 +1134,6 @@ - (void)callDidDisconnect {
dispatch_get_main_queue(), ^{
[[RCCall sharedRCCall] dismissCallViewController:self];
});
[self removeProximityMonitoringObserver];
}

/*!
Expand Down Expand Up @@ -1305,36 +1304,6 @@ - (void)registerTelephonyEvent {
};
}

#pragma mark - proximity
- (void)addProximityMonitoringObserver {
[UIDevice currentDevice].proximityMonitoringEnabled = YES;

[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(proximityStatueChanged:)
name:UIDeviceProximityStateDidChangeNotification
object:nil];
}

- (void)removeProximityMonitoringObserver {
[UIDevice currentDevice].proximityMonitoringEnabled = NO;

[[NSNotificationCenter defaultCenter]
removeObserver:self
name:UIDeviceProximityStateDidChangeNotification
object:nil];
}

- (void)proximityStatueChanged:(NSNotificationCenter *)notification {
// if ([UIDevice currentDevice].proximityState) {
// [[AVAudioSession sharedInstance]
// setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
// } else {
// [[AVAudioSession sharedInstance]
// setCategory:AVAudioSessionCategoryPlayback error:nil];
// }
}

#pragma mark - outside callback
- (void)callWillConnect {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,11 @@ - (void)subVideoViewClicked {
[self.remotePortraitView
setImageURL:[NSURL URLWithString:userInfo.portraitUri]];


[self.callSession setVideoView:self.mainVideoView
userId:self.remoteUserInfo.userId];
[self.callSession
setVideoView:self.subVideoView
userId:[RCIMClient sharedRCIMClient].currentUserInfo.userId];
[self.callSession setVideoView:self.mainVideoView
userId:self.remoteUserInfo.userId];
}
}

Expand Down
2 changes: 1 addition & 1 deletion ios-rongcallkit/RongCallKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.8.15</string>
<string>2.8.16</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
38 changes: 36 additions & 2 deletions ios-rongcallkit/RongCallKit/RCCall.mm
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,14 @@ - (BOOL)preCheckForStartCall:(RCCallMediaType)mediaType {
}
}

- (void)presentCallViewController:(UIViewController *)viewController{
- (void)presentCallViewController:(UIViewController *)viewController {
[[[UIApplication sharedApplication] keyWindow] endEditing:YES];
UIWindow *activityWindow =
[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
activityWindow.windowLevel = UIWindowLevelAlert;
activityWindow.rootViewController = viewController;
[activityWindow makeKeyAndVisible];
[self addProximityMonitoringObserver];
CATransition *animation = [CATransition animation];
[animation setDuration:0.3];
animation.type = kCATransitionMoveIn; //可更改为其他方式
Expand All @@ -251,6 +252,9 @@ - (void)presentCallViewController:(UIViewController *)viewController{
}

- (void)dismissCallViewController:(UIViewController *)viewController {
if (self.currentCallSession == nil) {
[self removeProximityMonitoringObserver];
}

if ([viewController isKindOfClass:[RCCallBaseViewController class]]) {
UIViewController *rootVC = viewController;
Expand Down Expand Up @@ -433,6 +437,36 @@ - (void)loadErrorAlertWithConfirm:(NSString *)title
[alert show];
}

#pragma mark - proximity
- (void)addProximityMonitoringObserver {
[UIDevice currentDevice].proximityMonitoringEnabled = YES;

[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(proximityStatueChanged:)
name:UIDeviceProximityStateDidChangeNotification
object:nil];
}

- (void)removeProximityMonitoringObserver {
[UIDevice currentDevice].proximityMonitoringEnabled = NO;

[[NSNotificationCenter defaultCenter]
removeObserver:self
name:UIDeviceProximityStateDidChangeNotification
object:nil];
}

- (void)proximityStatueChanged:(NSNotificationCenter *)notification {
// if ([UIDevice currentDevice].proximityState) {
// [[AVAudioSession sharedInstance]
// setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
// } else {
// [[AVAudioSession sharedInstance]
// setCategory:AVAudioSessionCategoryPlayback error:nil];
// }
}

- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
Expand Down
31 changes: 0 additions & 31 deletions ios-rongcallkit/RongCallKit/Utility/RCCallFloatingBoard.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ - (void)initBoard {
selector:@selector(onOrientationChanged:)
name:UIApplicationDidChangeStatusBarOrientationNotification
object:nil];
[self addProximityMonitoringObserver];
}

- (void)registerTelephonyEvent {
Expand Down Expand Up @@ -419,7 +418,6 @@ - (void)callDidDisconnect {
withObject:nil
afterDelay:2];
[RCCallKitUtility clearScreenForceOnStatus];
[self removeProximityMonitoringObserver];
}

/*!
Expand Down Expand Up @@ -515,33 +513,4 @@ - (void)shouldStopAlertAndRing {
*/
- (void)errorDidOccur:(RCCallErrorCode)error {
}

- (void)addProximityMonitoringObserver {
[UIDevice currentDevice].proximityMonitoringEnabled = YES;

[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(proximityStatueChanged:)
name:UIDeviceProximityStateDidChangeNotification
object:nil];
}

- (void)removeProximityMonitoringObserver {
[UIDevice currentDevice].proximityMonitoringEnabled = NO;

[[NSNotificationCenter defaultCenter]
removeObserver:self
name:UIDeviceProximityStateDidChangeNotification
object:nil];
}

- (void)proximityStatueChanged:(NSNotificationCenter *)notification {
// if ([UIDevice currentDevice].proximityState) {
// [[AVAudioSession sharedInstance]
// setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
// } else {
// [[AVAudioSession sharedInstance]
// setCategory:AVAudioSessionCategoryPlayback error:nil];
// }
}
@end
6 changes: 0 additions & 6 deletions ios-rongcallkit/RongCallKit/Utility/RCCallKitUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ + (NSString *)getReadableStringForMessageCell:
hangupReasonString = NSLocalizedStringFromTable(@"VoIPCallRemoteNoResponse",
@"RongCloudKit", nil);
break;
case RCCallDisconnectReasonAddToBlackList:
hangupReasonString = NSLocalizedStringFromTable(@"VoIPCallHasReject", @"RongCloudKit", nil);
break;
default:
hangupReasonString = [self getGeneralReadableString:hangupReason];
break;
Expand Down Expand Up @@ -149,9 +146,6 @@ + (NSString *)getReadableStringForCallViewController:
hangupReasonString = NSLocalizedStringFromTable(
@"VoIPCallRemoteBusyLineAndShowAdvice", @"RongCloudKit", nil);
break;
case RCCallDisconnectReasonAddToBlackList:
hangupReasonString = NSLocalizedStringFromTable(@"VoIP_Rejected_By_Blacklist", @"RongCloudKit", nil);
break;
default:
hangupReasonString = [self getGeneralReadableString:hangupReason];
break;
Expand Down
Binary file not shown.
Loading

0 comments on commit fd58135

Please sign in to comment.