Skip to content

Commit

Permalink
react-native-webrtc#174 Fix audio category restore for setForceSpeake…
Browse files Browse the repository at this point in the history
…rphoneOn as setting audio mode would have no effect on invalid audio category.
  • Loading branch information
Romick2005 committed Nov 16, 2021
1 parent 54bd8d4 commit f9b2c97
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ios/RNInCallManager/RNInCallManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,15 @@ - (void)updateAudioRoute
NSLog(@"RNInCallManager.updateAudioRoute(): did NOT overrideOutputAudioPort()");
}

if (![_audioSession.category isEqualToString:_incallAudioCategory]) {
[self audioSessionSetCategory:_incallAudioCategory
options:0
callerMemo:NSStringFromSelector(_cmd)];
NSLog(@"RNInCallManager.updateAudioRoute() audio category has changed to %@", _incallAudioCategory);
} else {
NSLog(@"RNInCallManager.updateAudioRoute() did NOT change audio category");
}

if (audioMode.length > 0 && ![_audioSession.mode isEqualToString:audioMode]) {
[self audioSessionSetMode:audioMode
callerMemo:NSStringFromSelector(_cmd)];
Expand Down

0 comments on commit f9b2c97

Please sign in to comment.