Closed EINS-SD-MOHAMMED closed 1 month ago
android and iOS have slightly different rules.
on Android you can use desc.write(..)
for the CCCD, on iOS: you must you chr.setNotifyValue
.
ideally we would prevent this on Android as well, so they both behave the same.
If you want, you can open a PR to prevent this on Android (with a flag to allow it). But otherwise, I will close this since I do not intend to fix it.
something like
desc.write(allowCccdWritesOnAndroid: true)
It seems that on iOS, we're not receiving any data, even though the BLE device has sent it. We’re getting a List
Requirements
Have you checked this problem on the example app?
No
FlutterBluePlus Version
1.33.5
Flutter Version
3.24.3
What OS?
iOS
OS Version
18.0.1
Bluetooth Module
Nedap Nvite Reader
What is your problem?
I am trying to connect to the Nedap Nvite reader using the Flutter Blue Plus package in my mobile app. The connection process works correctly on Android, allowing me to communicate with the device and enable notifications without issues.
However, on iOS, after successfully connecting to the Nedap Nvite reader and retrieving the characteristic properties, I encounter an error when attempting to enable notifications. Specifically, after calling setNotifyValue(true), when I try to write to the descriptor, I receive the following error:
PlatformException(iosException, Client Characteristic Configuration descriptors must be configured using setNotifyValue:forCharacteristic:, in flutter_blue_plus)
This error indicates that the notification configuration is not being handled correctly on iOS, while the same steps work fine on Android.
I have also gone through the closed issues related to this problem but have not been able to resolve the issue.
For a better understanding of the issue, I will be sharing the logs from both Android and iOS. Any guidance on resolving this iOS-specific issue would be greatly appreciated!
Logs