Skip to content

Feat/device setup#1409

Draft
marcosinigaglia wants to merge 4 commits into
masterfrom
feat/device-setup
Draft

Feat/device setup#1409
marcosinigaglia wants to merge 4 commits into
masterfrom
feat/device-setup

Conversation

@marcosinigaglia

@marcosinigaglia marcosinigaglia commented Dec 17, 2025

Copy link
Copy Markdown
Member

This pull request introduces a broad renaming and refactoring of the "companion" device setup feature across both Android and iOS platforms, standardizing terminology to "device setup" and improving code robustness and clarity. It also updates the example app to use the new APIs, enhances Bluetooth scanning logic, and adds iOS 18 AccessorySetupKit support for device setup. Below are the most important changes grouped by theme:

API and Naming Standardization:

  • Renamed all "companion" methods, events, and variables to "device setup" equivalents in both Android (BleManager.java, CompanionScanner.java) and iOS (BleManager.h, BleManager.mm, SwiftBleManager.swift), including exported methods like companionScandeviceSetupScan, supportsCompanionsupportsDeviceSetup, and related event emitters. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

iOS Device Setup Support:

  • Added initial support for iOS 18's AccessorySetupKit, including a method to build a payload from an ASAccessory, and session management for accessory setup flows in SwiftBleManager.swift. [1] [2]

Android Robustness Improvements:

  • Improved null-safety and error handling in CompanionScanner.java by using Objects.requireNonNull and checking for nulls before accessing values. [1] [2] [3]

Example App Updates:

  • Updated the example app to use the new "device setup" APIs, increased scan duration, set a specific service UUID, and improved Bluetooth initialization logic to ensure the BLE manager is started before scanning. Also cleaned up UI and button logic for device setup and Bluetooth enabling. [1] [2] [3] [4] [5] [6] [7] [8] [9]

iOS Permissions:

  • Added required iOS AccessorySetupKit and Bluetooth permissions to the example app's app.config.js for iOS 18 compatibility.

@lucaswitch

Copy link
Copy Markdown
Contributor

Hey whats left for this PR be approved?

@marcosinigaglia

Copy link
Copy Markdown
Member Author

Hey whats left for this PR be approved?

Hi, It's not complete and I don't have time now. Also I'm not convinced it's the right solution, the mechanisms are different, and it might be better to keep them separate by platform.

@lucaswitch

lucaswitch commented May 28, 2026 via email

Copy link
Copy Markdown
Contributor

@lucaswitch

lucaswitch commented May 28, 2026

Copy link
Copy Markdown
Contributor

Hey whats left for this PR be approved?

Hi, It's not complete and I don't have time now. Also I'm not convinced it's the right solution, the mechanisms are different, and it might be better to keep them separate by platform.

I can help you with that, we just need to agree on unified api for both platforms.
Cause having two separated apis will cause a initial friction on using it.

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.

2 participants