Skip to content
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

BLUETOOTH Device not listed #236

Open
mudioo opened this issue Feb 14, 2024 · 2 comments
Open

BLUETOOTH Device not listed #236

mudioo opened this issue Feb 14, 2024 · 2 comments

Comments

@mudioo
Copy link

mudioo commented Feb 14, 2024

Hello, i am trying to get the list of all audio devices wich are connected to a android phone.

InCallManager.start({ media: "audio" });

DeviceEventEmitter.addListener("onAudioDeviceChanged", (event) => {
  console.log(event.availableAudioDeviceList);
});

//output: ["EARPIECE","SPEAKER_PHONE"]
//expected output: ["BLUETOOTH","EARPIECE","SPEAKER_PHONE"]

I am trying it with a bluetooth speaker and with airpods on a xiaomi redmi 12 phone.

@wilmxre
Copy link

wilmxre commented Feb 19, 2024

you can try RNCallKeep.getAudioRoutes() or RNCallKeep.addListener('didChangeAudioRoute') and see if it gives you back the bluetooth device as expected

@junaiddarajat
Copy link

Only testing on Android right now, and I've used older version of the library (3.3.0) as well as the latest one, my Sony WH-1000XM5 headphones just do not show up to the availableAudioDevice

DeviceEventEmitter.addListener("onAudioDeviceChanged", (event) => {
        console.log({event});
        ...
});
{"event":{"selectedAudioDevice":"SPEAKER_PHONE","availableAudioDeviceList":"[\"SPEAKER_PHONE\",\"EARPIECE\"]"}}

However, attaching WIRED_HEADSET (USB Headset) works and the event even fires. So BLUETOOTH is just not being listed, at least with the device I tested just now.

Any clue why? BLUETOOTH permission for Android is given, verified to be at AndroidManifest.xml; (both BLUETOOTH (sdk 30) and BLUETOOTH_CONNECT) with newer library do we specifically have to request for bluetooth permission?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants