cordova-plugin-ble-central: iOS - startNotification callback not raised after disconnection from the peripheral
Hi !
I’m having this issue only on iOS with cordova-plugin-ble-central 1.1.9.
I’m connecting to a peripheral and listens to its notifications. Everything works fine.
Now, if I:
- disconnect from the iOS app and reconnect to the peripheral, everything is OK, I start notifications and receive them.
- turn off the peripheral and turn it on again. The app is able to find the peripheral, connect to it but the start notification callback will never be raised.
Can you please fix it?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (5 by maintainers)
Commits related to this issue
- More explicitly handle edge cases when starting/stopping notifications on iOS #577 This will now signal an error to the start and stop callbacks if the characteristic state does not match what is nee... — committed to don/cordova-plugin-ble-central by peitschie 2 years ago
- Merge pull request #893 from don/ios-notifications-race-fix More explicitly handle edge cases when starting/stopping notifications on iOS #577 — committed to don/cordova-plugin-ble-central by peitschie 2 years ago
Yeah, I wasn’t sure if it was the same because we were not disconnecting first.
I’ve noticed that if the
startNotificationfails during setup on iOS that the error is never passed back to the javascript layer. I’m not sure why reconnecting would impact this or make it more likely to fail however, unless the peripheral is rejecting the request to activate notifications for some reason.There’s an obvious bug to fix at least, so I’ll put up a PR for this.