Listen to bluetooth disabled on iOS

354 Views Asked by At

I'm creating a Bluetooth application, and I'm trying to listen to Bluetooth events.

I'm using react-native-bluetooth-classic library:
https://kenjdavidson.com/react-native-bluetooth-classic/api-overview/

I've succeeded listen to onDeviceRead from the Bluetooth device on both android and iOS, but I can't listen to onStateChanged / onBluetoothEnabled / onBluetoothDisabled on iOS (but I can on android).

I've tried to create an event listener by myself to listen to these events with NativeAppEventEmitter and DeviceEventEmitter, but it's still not working for iOS.

addEventListener('BLUETOOTH_ENABLED', doSomething);
addEventListener('BLUETOOTH_DISABLED', doSomething);

what could be the issue?

0

There are 0 best solutions below