Skip to content

Commit f9b2c97

Browse files
committed
#174 Fix audio category restore for setForceSpeakerphoneOn as setting audio mode would have no effect on invalid audio category.
1 parent 54bd8d4 commit f9b2c97

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ios/RNInCallManager/RNInCallManager.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,15 @@ - (void)updateAudioRoute
493493
NSLog(@"RNInCallManager.updateAudioRoute(): did NOT overrideOutputAudioPort()");
494494
}
495495

496+
if (![_audioSession.category isEqualToString:_incallAudioCategory]) {
497+
[self audioSessionSetCategory:_incallAudioCategory
498+
options:0
499+
callerMemo:NSStringFromSelector(_cmd)];
500+
NSLog(@"RNInCallManager.updateAudioRoute() audio category has changed to %@", _incallAudioCategory);
501+
} else {
502+
NSLog(@"RNInCallManager.updateAudioRoute() did NOT change audio category");
503+
}
504+
496505
if (audioMode.length > 0 && ![_audioSession.mode isEqualToString:audioMode]) {
497506
[self audioSessionSetMode:audioMode
498507
callerMemo:NSStringFromSelector(_cmd)];

0 commit comments

Comments
 (0)