-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ios): The getAudioRoutes changes the selected audio route #557
base: master
Are you sure you want to change the base?
Conversation
@@ -570,20 +585,6 @@ + (NSArray *) getAudioInputs | |||
|
|||
AVAudioSession* myAudioSession = [AVAudioSession sharedInstance]; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and I noticed if we remove the setCategory
from the getAudioInputs
, the availableInputs are not up-to-date, I mean if in the meantime you remove a connected bluetooth device, the availableInputs are not updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nagyszili I am not seeing that issue. Are you relying on the RNCallKeepDidChangeAudioRoute
event or are you using the getAudioRoutes
method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using the getAudioRoutes
, please try it when a call is connected, my suggestion is to set the category in the getAudioInputs
when there is no call connected
@rcidt First of all, thank you for PR! I found your sumbission when I faced with another issue - #getAudioRoutes seems not working when an incoming call is ringing but not answered yet. The flow is following (iOS only!):
Without your fix, I catch the exception at react-native-callkeep/ios/RNCallKeep/RNCallKeep.m Lines 593 to 598 in 8de84e3
Log:
With your fix, the flow works great! Several things to mention:
NSArray *ports = [RNCallKeep getAudioInputs];
BOOL isCategorySetted = [myAudioSession setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:&err];
if (!isCategorySetted)
{
NSLog(@"[RNCallKeep][setAudioRoute] setCategory failed");
[NSException raise:@"setCategory failed" format:@"error: %@", err];
}
BOOL isCategoryActivated = [myAudioSession setActive:YES error:&err];
if (!isCategoryActivated)
{
NSLog(@"[RNCallKeep][setAudioRoute] setActive failed");
[NSException raise:@"setActive failed" format:@"error: %@", err];
}
// => may be invoke getAudioInputs here after setting stuff ?
for (AVAudioSessionPortDescription *port in ports) { what about get the audio inputs after setting stuff ? |
…ond bounds for empty NSArray
Bluetooth override
Additional flag fix if BT selected back as primary
This reverts commit dcc5158.
…droid native call and iOS mob app)
… user receives incoming n2p call when on ongoing conference call
… from native call history on iPhone (CS3)
bug/MOB-5329: iOS: No outbound call ringing sound when placing a call from native call history on iPhone (CS3)
Hello, I am still experiencing this issue - can we get this merged / released? |
Fixes #540