Skip to content

Conversation

@marcosinigaglia
Copy link
Member

@marcosinigaglia marcosinigaglia commented Dec 17, 2025

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.

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