React Native - Detect connected Bluetooth devices and integrate them with InCallManager

24 Views Asked by At

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()
  };
};
0

There are 0 best solutions below