Skip to content

Commit

Permalink
Merge pull request #200 from PhilipsHue/fix-race-condition-background…
Browse files Browse the repository at this point in the history
…-messaging-fb

fix reinitializing of the eventchannel scanparameter by firebase
  • Loading branch information
remonh87 authored Jan 25, 2021
2 parents 7915379 + f6e65d9 commit dcbf292
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.7.2

* Fix #188 `subscribeToCharacteristic` fails when characteristic config descriptor is not present.
* Fix #195 `scanFailure` when using backgroundmode messaging Firebase.

## 2.7.1

* Fix #115 by updating to new protobuf lite on Android.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ class ScanDevicesHandler(private val bleClient: com.signify.hue.flutterreactiveb
private var scanDevicesSink: EventChannel.EventSink? = null
private lateinit var scanForDevicesDisposable: Disposable
private val converter = ProtobufMessageConverter()
private var scanParameters: ScanParameters? = null

companion object {
private var scanParameters: ScanParameters? = null
}

override fun onListen(objectSink: Any?, eventSink: EventChannel.EventSink?) {
eventSink?.let {
Expand Down Expand Up @@ -51,7 +54,7 @@ class ScanDevicesHandler(private val bleClient: com.signify.hue.flutterreactiveb
it.dispose()
scanParameters = null
}
}
}
}

fun prepareScan(scanMessage: pb.ScanForDevicesRequest) {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.7.1"
version: "2.7.2"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_reactive_ble_example
description: Demonstrates how to use the flutter_reactive_ble plugin.
version: 2.7.1
version: 2.7.2
publish_to: 'none'

environment:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_reactive_ble
description: Reactive Bluetooth Low Energy (BLE) plugin that can communicate with multiple devices
version: 2.7.1
version: 2.7.2
homepage: https://github.com/PhilipsHue/flutter_reactive_ble

environment:
Expand Down

0 comments on commit dcbf292

Please sign in to comment.