Skip to content

Merge upstream master: SwiftPM support, AGP 9 / built-in Kotlin, async subscriptions - #3

Merged
dballance merged 37 commits into
masterfrom
feat/swiftpm-support
Nov 2, 2026
Merged

dballance merged 37 commits into
masterfrom
feat/swiftpm-support

Conversation

@tango-tango-mashbill

@tango-tango-mashbill tango-tango-mashbill Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Pull request updated by mashbill for dballance from a mashbill Session.


Brings the fork's master up to date. It merges PhilipsHue/flutter_reactive_ble master (e8b43fb) with our feat/session-restoration work (5425f31), so that reactive_ble_mobile supports Swift Package Manager on iOS/macOS. All fork features are kept. After this lands, master holds the latest upstream plus our changes. It also covers #1, whose 25 commits are included with unchanged SHAs.

Merge with "Create a merge commit", not squash or rebase. Shine pins f0c8667, which has to stay reachable from master. Squashing would also make the next upstream merge conflict again.

Upstream adds 15 commits since the fork point (a6dd926, June 2024), including:

Commits

  • e696ae2: the merge, with conflict resolutions.
  • f0c8667: raises the minimum SwiftProtobuf to 1.31.0 in Package.swift and ~> 1.31 in the podspec, because the regenerated Swift needs it. Also fixes the protoc output path in protos/README.md.

Conflict resolutions

  • connected_device_operation.dart, reactive_ble.dart: kept the fork's attachToCharacteristicSubscription / attachToSubscription and upstream's subscribeToCharacteristicAsync / subscribeAsync. Platform setup is now isAndroid || isIOS || isMacOS and still passes restorationKey.
  • reactive_ble_mobile/android/build.gradle: took upstream (AGP 9.1, built-in Kotlin, SDK 37). The fork's only change there was an SDK bump.
  • Generated protobuf (bledata.pb*.dart, bledata.pb.swift): regenerated from the merged bledata.proto with protoc 34.1, protoc_plugin 25.0.0 and protoc-gen-swift 1.36.1. Compared with upstream's files, the only additions are the fork's messages.
  • Mocks and pubspec.lock files: regenerated with build_runner and flutter pub get.
  • Example app:
    • example/android/*, AppDelegate.swift: took upstream; the fork only had version bumps there.
    • Podfile.lock: deleted, as upstream did.
    • project.pbxproj: the Pods references are removed. A broken Info-Debug.plist reference was replaced with upstream's Info.plist.

iOS source move

  • Everything in ios/Classes/ now lives in darwin/reactive_ble_mobile/Sources/reactive_ble_mobile/, including the fork-only BleData extras/RestoredPeripheral.swift.
  • ios/ is gone, and nothing references SwiftReactiveBlePlugin any more.
  • Fork logic in PluginController.swift, Central.swift, CentralManagerDelegate.swift and ReactiveBlePlugin.swift is intact:
    • the restore identifier and willRestoreState
    • the restored_device and bond_update event channels
    • initialize with InitializationRequest
  • Fix: the fork's event channels used registrar.messenger(), which doesn't compile on macOS. They now use the shared messenger.

Verification

  • flutter analyze is clean in all packages, and flutter test passes: 4, 93, 61 and 1 tests.
  • swiftc -parse passes on all Swift files.
  • The plugin type-checks against stubbed CoreBluetooth/Flutter modules on Linux.
  • In shine (AGP 9.1.1, builtInKotlin=false), :reactive_ble_mobile:compileDebugKotlin succeeds.

Needs a Mac / device check

  • A real Xcode build with SwiftPM on and with CocoaPods. The stubs can't confirm that CoreBluetooth delegate signatures match Apple's API.
  • State restoration on a device, including re-attach on top of feat: Add async characteristic subscription that awaits BLE setup PhilipsHue/flutter_reactive_ble#945's async subscribe.
  • The podspec still has upstream's Protobuf ~> 3.5 and swift_version 4.2. Check these don't clash with the app's Pods.
  • The example's Info-Release.plist reference points to a missing file. This was already true before the merge.

Future upstream updates

Run git fetch upstream && git merge upstream/master on a branch, then open a PR into master and merge it with a merge commit. Regenerate the generated files (protobuf, mocks, lock files) rather than resolving them by hand.

taylorbell and others added 30 commits November 21, 2024 11:36
This applies the changes from f880ed8
with some additional changes to clean up merge conflicts and fix broken
tests.
This refactors the device restoration logic to emit a stream of
`RestoredDevice` objects on session restoration. Each device will have a
set of metadata as well as streams for the connection state as well as
any characteristic subscriptions established in a previous session.

Each stream provides the same functionality as a standard connection or
characteristic stream and will disconnect/unsubscribe on calling
`cancel()`.
This passes an empty restored device info collection to the restored
device event stream on Android to ensure the stream will emit a done
event.
This doesn't fully prevent duplicate emissions but should ensure
duplicates aren't emitted during connection and initial pairing when it
is most important.
feat: add support for monitoring ble device bond status changes
* Bump protobuf to 6.0.0

* Ran protobuf codegen

* Bump internal updates

* Bump flutter version for flutter workflow image

* Bump flutter version for flutter workflow image to 3.41.5

---------

Co-authored-by: PieterAelse <pieter.otten@signify.com>
PieterAelse and others added 6 commits April 1, 2026 16:41
* Perform SPM migration

* Fix Dart analyzer issue

---------

Co-authored-by: Rutger Vromans <rutger.vromans@signify.com>
* [REF] Update to match Flutter 3.47 requirements, keep minimum at 3.44
- Upgrade SDK to 37
- Upgrade Kotlin to 2.4.10
- Upgrade AGP to 9.3.1
- Upgrade gradle to 9.5.0
- Migrate to built-in Kotlin
…ilipsHue#945)

The existing `subscribe()` method returns a stream immediately, potentially leading to race conditions or unhandled errors if the underlying BLE notification setup fails or is delayed. This new `subscribeAsync()` method waits for the BLE subscription on the native platform to be fully established before returning the stream, providing a more robust and predictable API.
…characteristic subscription

Merges PhilipsHue/flutter_reactive_ble master (7ba36e5 PhilipsHue#932, 6b81c85 PhilipsHue#938,
e8b43fb PhilipsHue#945) into the fork while keeping session restoration, bond-state
monitoring, attach-to-subscription and the proto additions.

- iOS sources moved to darwin/reactive_ble_mobile/Sources/reactive_ble_mobile
  (incl. fork-only BleData extras/RestoredPeripheral.swift); plugin class is
  now ReactiveBlePlugin. Fork event channels (restored_device, bond_update)
  use the shared iOS/macOS messenger.
- Kept both attachToCharacteristicSubscription (fork) and
  subscribeToCharacteristicAsync (upstream); restorationKey is passed on
  Android/iOS/macOS.
- Regenerated bledata protobuf (protoc 34.1, protoc_plugin 25.0.0,
  protoc-gen-swift 1.36.1) from the merged proto, mocks and lock files.
- Android build.gradle: took upstream SDK 37 / AGP 9 / built-in Kotlin.

Co-authored-by: dballance <1234523+dballance@users.noreply.github.com>
…th in README

Generated bledata.pb.swift (protoc-gen-swift 1.36.1) uses the bytecode
_NameMap initializer added in SwiftProtobuf 1.31.0; the previous
'~> 1.0' / from: "1.0.0" constraints allowed incompatible versions.

Co-authored-by: dballance <1234523+dballance@users.noreply.github.com>
@tango-tango-mashbill
tango-tango-mashbill Bot changed the base branch from feat/session-restoration to master November 2, 2026 21:03
@dballance
dballance marked this pull request as ready for review November 2, 2026 21:19
Co-authored-by: dballance <1234523+dballance@users.noreply.github.com>
@dballance
dballance merged commit 77d97c1 into master Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants