From d6b763c702276ae540f586fe04a94eac99c128c9 Mon Sep 17 00:00:00 2001 From: Sasa Obadic Date: Fri, 14 Oct 2022 15:45:51 +0200 Subject: [PATCH] Additional flag fix if BT selected back as primary --- ios/RNCallKeep/RNCallKeep.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ios/RNCallKeep/RNCallKeep.m b/ios/RNCallKeep/RNCallKeep.m index 5b180568..c3e8e35a 100644 --- a/ios/RNCallKeep/RNCallKeep.m +++ b/ios/RNCallKeep/RNCallKeep.m @@ -545,7 +545,12 @@ + (void)setup:(NSDictionary *)options { BOOL isSetted = [myAudioSession setPreferredInput:(AVAudioSessionPortDescription *)port error:&err]; if (isSetted) { - _shouldForceBluetooth = FALSE; + if ([port.portType isEqualToString:AVAudioSessionPortBluetoothHFP] || + [port.portType isEqualToString:AVAudioSessionPortBluetoothA2DP]) { + _shouldForceBluetooth = TRUE; + } else { + _shouldForceBluetooth = FALSE; + } } if(!isSetted){