dotintent / react-native-ble-plx

React Native BLE library
Apache License 2.0
2.94k stars 492 forks source link

Failed remove of monitorCharacteristicForService callback listener #1182

Closed george-eucare closed 1 month ago

george-eucare commented 2 months ago

when execute bleManager.cancelDeviceConnection(device.id),
monitorCharacteristicForService callback listener will be invoke.


subscription = monitorCharacteristicForService(
  serviceUUID,
  characteristicsUUID, 
  (error) => { console.log(error) } //  console error when bleManager.cancelDeviceConnection(device.id),
  'xxxID'
)

already try cancel and remove before cancelDeviceConnection()

bleManager.cancelTransaction('xxxID');
subscription.remove();

_Originally posted by @george-eucare in https://github.com/dotintent/react-native-ble-plx/issues/454#issuecomment-2014542770_