Skip to content

Commit

Permalink
Fix emitting current connection state on iOS (#547)
Browse files Browse the repository at this point in the history
Fixes #540
  • Loading branch information
mikolak authored Nov 17, 2020
1 parent dc3f8f5 commit 33afb00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 2.3.1

* Fix connection timeout on iOS
* Fix emitting current connection state on iOS

## 2.3.0

Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/FlutterBleLibPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ - (void)observeConnectionState:(FlutterMethodCall *)call result:(FlutterResult)r
BOOL emitCurrentValue = ((NSNumber *)call.arguments[ARGUMENT_KEY_EMIT_CURRENT_VALUE]).boolValue;
if (emitCurrentValue == YES) {
Resolve resolve = ^(id isConnected) {
if ((BOOL)isConnected == YES) {
if ([isConnected boolValue] == YES) {
[self.connectionStateStreamHandler onConnectedEvent:call.arguments[ARGUMENT_KEY_DEVICE_IDENTIFIER]];
} else {
[self.connectionStateStreamHandler emitDisconnectedEvent:call.arguments[ARGUMENT_KEY_DEVICE_IDENTIFIER]];
Expand Down

0 comments on commit 33afb00

Please sign in to comment.