-
Notifications
You must be signed in to change notification settings - Fork 344
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
iOS crashes trying to read notification data after connection has been established. #251
Comments
As a workaround, have you tried putting an extra delay before subscribing to the characteristic? (300–500 ms) Does it make any difference? |
I tried that but unfortunately it did not help. |
Are you working with a custom peripheral? (that is one of the questions in the suggested issue template, by the way) Is there anything special in it's behavior? |
Sorry, yes I forgot to mention, it is a custom peripheral offering one service with 3 notification characteristics. There is nothing special about this device and it works without problems with the same dart-code on android devices. Which additional information could be helpful? |
Hm, if you know: does you peripheral always immediately sends an update when a new subscription is established? As a workaround, if you have control over this, you could try introducing a delay of a few hundreds milliseconds before sending the first update on the peripheral side. Ah, here it is: #137. Exactly your case. You may want to check the discussion there. |
ok, thank you. |
Don't get me wrong. There is still a bug in the library (we can track it in #137). But it's better to have a bug with a workaround, than without 🙂 |
...and after a couple of test-runs it seems that the workaround only helps every 2nd time. The crashes happen on every 2nd attempt to read the subscribed notification data. in addition, I do receive flutter messages that the connection has timed out unexpectedly:
|
I changed the delay to 500ms and now I get a 50% change of app crash. Has the fix for #137 made it into 2.7.3 or should I pull it separately as a dependency override to test? |
The pull-request #139 was supposed to fix #137, but it had little to no effect to the issue for those who were experiencing it. #137 is still open. If you come up with a good structural fix, that would be a very welcome contribution. I'm not going to have a lot of time to work on it for quite a long time, it seems. |
Hello, I'm not good to add this plugin into my flutter app, can you provide me please a project that can detect my real device beacon ? Thank you very much! |
@peterpoll please file a new issue for your question since it is not related to this issue. Thanks!
|
Queue up messages until event-sink has been created Closes PhilipsHue#307, PhilipsHue#251, PhilipsHue#137
Queue up messages until event-sink has been created Closes PhilipsHue#307, PhilipsHue#251, PhilipsHue#137
I experience 100% reproducible crashes, trying to subscribe to a notification stream after the connection has been established.
I do search for BLE devices and connect to the right one offering the service I need. After that I move on to a new screen and subscribe to a notification characteristic. This is where the crash happens.
I am on iOS 14
Flutter 2.1
flutter_reactive_ble 2.7.3
Here's my crash report:
The text was updated successfully, but these errors were encountered: