twilio/twilio-voice-react-native

[Android] Bluetooth Headset keys not able to answer/reject incoming calls

Closed this issue · 4 comments

We have integrated the Twilio Voice SDK into our React Native project, and while it mostly functions as expected, we've encountered an issue with Bluetooth headsets on Android devices. When a call comes in, pressing the buttons on the Bluetooth headset doesn't affect the call notification. Ideally, the headset buttons should allow us to accept or reject the call. I've verified that this isn't a problem with the Bluetooth headset itself, as it works correctly for answering regular cellular calls.

  • [ YES] I have verified that the issue occurs with the latest release and is not marked as a known issue in the CHANGELOG.md.
  • [YES] I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • [YES] I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

I have also confirmed that Bluetooth works for VOIP calls once I manually accept the call from the notification. I can switch to my Bluetooth device, use its microphone, and listen to the caller's audio through the headset. However, the issue remains that the answer/reject functionality via the headset buttons is not working.

Reproduction Steps

  1. Connect a bluetooth device to android
  2. Make an inbound call
  3. Press the keys on bluetooth device

Expected Behavior

Should ideally answer or reject the call according to the key pressed.

Actual Behavior

Nothing happens on key press

Reproduction Frequency

100%

Software and Device Information

  • Device: Nothing Phone 1
  • OS: Android 14

Any help is appreciated!

Hello @thetyagiayush thanks for reaching out to us. I've internally asked our Android expert to weigh in. In the meantime, could you also provide some more version info, like React Native version, are you using expo, etc.

@mhuynh5757 Hey, I am using React native 0.74.3 and No, I am not using Expo

@thetyagiayush Voice RN uses AudioSwitch to manage bluetooth. AudioSwitch does not support bluetooth device actions. Those tend to be manufacturer specific. AudioSwitch is open source, which you can modify to support your bluetooth headset keys. For more info on how to, look here.

https://github.com/twilio/audioswitch

Hey all, going to close this question as answered for now. Please reach out if you need further assistance.