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

Error unsubscribing from notifications: PlatformException(reactive_ble_mobile.Central.(unknown context at $101519dac).Failure:1, The operation couldn’t be completed. (reactive_ble_mobile.Central.(unknown context at $101519dac).Failure error 1.), {}, null) #884

Open
1 task
EINS-SD-MOHAMMED opened this issue Oct 19, 2024 · 0 comments

Comments

@EINS-SD-MOHAMMED
Copy link

Describe the bug
I am experiencing an issue with BLE notifications in my Flutter application using the flutter_reactive_ble package. Notifications work correctly on Android, but on iOS, they automatically unsubscribe without any explicit action, leading to no notifications being received.
I receive the following error:
Error unsubscribing from notifications: PlatformException(reactive_ble_mobile.Central.(unknown context at $101c31dac).Failure:1, The operation couldn’t be completed. (reactive_ble_mobile.Central.(unknown context at $101c31dac).Failure error 1.), {}, null)

To Reproduce
Steps to reproduce the behavior:

  1. Connect to a BLE device that supports notifications.
  2. Subscribe to notifications for a characteristic.
  3. Send data to the characteristic using writeCharacteristicWithoutResponse.
  4. Observe that notifications are received on Android, but on iOS, they stop with an error as:
    Error unsubscribing from notifications: PlatformException(reactive_ble_mobile.Central.(unknown context at $101c31dac).Failure:1, The operation couldn’t be completed. (reactive_ble_mobile.Central.(unknown context at $101c31dac).Failure error 1.), {}, null)

Expected behavior
I expect to receive notifications continuously from the device on both iOS and Android after sending data.

  • I tried doing the same with a general BLE scanner application (e.g. nRF Connect) and it exhibits the expected behavior as described above: Not Used

Smartphone / tablet

  • Iphone 15 Plus
  • OS: iOS 18.0.1
  • Package version: 5.3.1

Peripheral device

  • Vendor, model: Nedap NVite Reader
  • Does it run a custom firmware / software: no

Additional context
The logs for both the OS are as follows

Android Logs
D/BluetoothGatt(29225): connect() - device: XX:XX:XX:XX:36:BA, auto: true
D/BluetoothGatt(29225): registerApp()
D/BluetoothGatt(29225): registerApp() - UUID=376c6bd9-06a3-46b0-b08b-05af7be6a55b
D/BluetoothGatt(29225): onClientRegistered() - status=0 clientIf=5
D/BluetoothAdapter(29225): getBleEnabledArray(): ON
D/BluetoothGatt(29225): onClientConnectionState() - status=0 clientIf=5 device=XX:XX:XX:XX:36:BA
D/BluetoothGatt(29225): discoverServices() - device: XX:XX:XX:XX:36:BA
D/BluetoothGatt(29225): onConnectionUpdated() - Device=XX:XX:XX:XX:36:BA interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt(29225): onSearchComplete() = Device=XX:XX:XX:XX:36:BA Status=0
I/flutter (29225): Service UUID: 00001800-0000-1000-8000-00805f9b34fb
I/flutter (29225): Service UUID: 00001801-0000-1000-8000-00805f9b34fb
I/flutter (29225): Service UUID: 0000180a-0000-1000-8000-00805f9b34fb
I/flutter (29225): Service UUID: 87b1de8d-e7cb-4ea8-a8e4-290209522c83
D/BluetoothGatt(29225): onConnectionUpdated() - Device=XX:XX:XX:XX:36:BA interval=39 latency=0 timeout=500 status=0
I/flutter (29225): Data sent: [8, 0, 0, 0, 0, 0, 0, 4, 88]
I/flutter (29225): isNotifiable: true
D/BluetoothGatt(29225): setCharacteristicNotification() - uuid: 540810c2-d573-11e5-ab30-625662870761 enable: true
I/flutter (29225): Got Notification
I/flutter (29225): Notification data: [65, 127, 143, 162, 132, 86, 72, 234, 172]
I/flutter (29225): 417f8fa2845648eaac
D/BluetoothGatt(29225): onClientConnectionState() - status=19 clientIf=5 device=XX:XX:XX:XX:36:BA
D/BluetoothGatt(29225): setCharacteristicNotification() - uuid: 540810c2-d573-11e5-ab30-625662870761 enable: false

iOS Logs
flutter: 080000000000000552
flutter: 7cfe70936cba9edcc187d53faf4b176b
Warning! No event channel set up to report a connection update
flutter: Service UUID: 180a
flutter: Service UUID: 87b1de8d-e7cb-4ea8-a8e4-290209522c83
flutter: isNotifiable: true
flutter: Data sent: [8, 0, 0, 0, 0, 0, 0, 5, 82]
flutter: Error unsubscribing from notifications: PlatformException(reactive_ble_mobile.Central.(unknown context at $101519dac).Failure:1, The operation couldn’t be completed. (reactive_ble_mobile.Central.(unknown context at $101519dac).Failure error 1.), {}, null)

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

1 participant