I've already implemented Bluetooth device detection using react-native-ble-plx and InCallManager using react-native-incall-manager, but I'm facing challenges integrating the two.
export const setupPermission = () => {
InCallManager.start({ video: true });
InCallManager.setKeepScreenOn(true);
InCallManager.setForceSpeakerphoneOn(true);
InCallManager.switchAudioDevice('SPEAKER_PHONE')
const emitter = DeviceEventEmitter.addListener('WiredHeadset', function (data) {
InCallManager.switchAudioDevice('WIRED_HEADSET')
});
return () => {
InCallManager.stop();
emitter.remove()
};
};