Skip to content

Commit 33afb00

Browse files
authored
Fix emitting current connection state on iOS (#547)
Fixes #540
1 parent dc3f8f5 commit 33afb00

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 2.3.1
22

33
* Fix connection timeout on iOS
4+
* Fix emitting current connection state on iOS
45

56
## 2.3.0
67

ios/Classes/FlutterBleLibPlugin.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ - (void)observeConnectionState:(FlutterMethodCall *)call result:(FlutterResult)r
235235
BOOL emitCurrentValue = ((NSNumber *)call.arguments[ARGUMENT_KEY_EMIT_CURRENT_VALUE]).boolValue;
236236
if (emitCurrentValue == YES) {
237237
Resolve resolve = ^(id isConnected) {
238-
if ((BOOL)isConnected == YES) {
238+
if ([isConnected boolValue] == YES) {
239239
[self.connectionStateStreamHandler onConnectedEvent:call.arguments[ARGUMENT_KEY_DEVICE_IDENTIFIER]];
240240
} else {
241241
[self.connectionStateStreamHandler emitDisconnectedEvent:call.arguments[ARGUMENT_KEY_DEVICE_IDENTIFIER]];

0 commit comments

Comments
 (0)