react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
901 stars 439 forks source link

iOS: When Bluetooth device is available, incoming call defaults to receiver/earpiece when answered #614

Open rcidt opened 1 year ago

rcidt commented 1 year ago

Bug report

Description

When a BT device is connected, outbound calls will automatically connect to the BT audio route.

But for inbound calls, the audio gets routed to the receiver/earpiece instead of BT.

When I print out the events for RNCallKeepDidChangeAudioRoute, I receive a bunch of them once I answer the call. Sometimes they start off as BT, but it gets overrode by subsequent events showing receiver as the audio route. These events are triggered outside of my app.

Steps to Reproduce

Connect your device to BT device. Place an inbound call to CallKit app. Answer the call. Notice the audio route is not BT.

Versions

- Callkeep: 4.3.3
- React Native: 0.66.3
- iOS: 15.4.1
- Android: N/A
- Phone model: iPhone 11

Logs

Paste here
AbdulBsit commented 1 year ago

It's the default behaviour of iOS

vishaldaher commented 1 month ago

It's the default behaviour of iOS

  • After tapping the answer button on iPhone, the default audio route is the iPhone speaker.
  • After tapping the answer button on a Bluetooth device, the default audio route is the Bluetooth device.

@AbdulBsit observed same. Is there any workaround to route audio to bluetooth device even when user answers call from iPhone?

AbdulBsit commented 1 month ago

@vishaldaher on didActivateAudioSession after call answer you can check for bluetooth device, if present just override it using RNCallKeep.setAudioRoute method, I would suggest to keep it as it is, as this is a default platform behaviour for iOS

vishaldaher commented 1 month ago

Thanks for Quick reply @AbdulBsit :)

I tried RNCallKeep.setAudioRoute but its not working. I am also agree with your suggestion to keep this as is as its default behaviour.