[iOS][0.9.0] Device.onDisconnected() emits nulls
See original GitHub issueWhen running the below code snippet the error is a null
instead of BleError
. It is observed on iOS
only.
device.onDisconnected((error) => {
console.log(typeof error); // 'object'
console.log(error === null); // 'true'
});
On Android the library seems to work just fine.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
[iOS][0.9.0] Device.onDisconnected() emits nulls #265 - GitHub
onDisconnected callback means that the connection was lost. The error is guaranteed to be set to null if you called bleManager.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cernadasjuan I basically had to work around the issue. I kept track of when my user purposefully tried to disconnect.
If my user tries to disconnect, and then we do disconnect, then I know it was on purpose.
If my user didn’t try to disconnect, and then we disconnect, then I know it was probably an error.
That seems to be reliable but I definitely would have preferred to rely on the API handling the situation the same way for iOS and android.
@cernadasjuan that’s awesome. Cheers!