companion_device_manager 1.0.0 copy "companion_device_manager: ^1.0.0" to clipboard
companion_device_manager: ^1.0.0 copied to clipboard

PlatformAndroid

Android-only Flutter plugin for Companion Device Manager (CDM) association and wake callbacks

1.0.0 #

  • Added Gradle 9 / Android Gradle Plugin 9.x compatibility: replaced the deprecated kotlinOptions { jvmTarget = ... } block (now a hard compile error under Kotlin 2.4 / AGP 9.1) with the kotlin { compilerOptions { jvmTarget = ... } } DSL.
  • Verified the plugin builds and compiles cleanly as a subproject in a host app using Gradle 9.3.1 / AGP 9.1.0 / Kotlin 2.4.0.
  • No public API changes; promoted to 1.0.0 as the first stable release.

0.2.5 #

  • Fixed a crash on Android 11 devices by only calling AssociationRequest.Builder.setDisplayName(...) on Android 13+ (API 33+).
  • Documented the API-level limitation for association display names in the public docs.

0.2.4 #

  • Removed direct application of org.jetbrains.kotlin.android from the plugin's Android Gradle script.
  • Updated Android plugin build setup to align with Flutter's upcoming requirement that plugins must not apply KGP directly.
  • Prevents future Flutter build failures related to plugin-level Kotlin Gradle Plugin usage.

0.2.3 #

  • Added REQUEST_COMPANION_RUN_IN_BACKGROUND and REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND permissions for enhanced background operation support on Android 12+ devices.
  • Improved handling of background presence observation to ensure stable callback execution across device lifecycle events.
  • Enhanced native debug logging for better troubleshooting of background callback and presence observation flows.
  • Updated Android manifest with strict permission requirements for background operations.

0.2.2 #

  • Breaking change: registerBackgroundCallback now requires an informative callback signature: Future<void> Function(CompanionDeviceEvent event).
  • Breaking change: CompanionDeviceEvent.type is now a typed enum (CompanionDeviceEventType) instead of String.
  • Added dispatcher-based background delivery bridge so headless callback execution receives the exact event payload from Android safely.
  • Background callback payload now carries event type + association data (including MAC address) for direct business-logic handling.
  • Updated example app and docs for enum-based event handling and the new callback signature.

0.2.1 #

  • Added CompanionDeviceManager.associateByMacAddress(String macAddress) convenience API for MAC-only association requests.
  • Added CompanionDeviceManager.disassociateByMacAddress(String macAddress) convenience API for cross-session disassociation using only MAC address.
  • Added strict MAC format validation (XX:XX:XX:XX:XX:XX) and uppercase normalization for the new convenience APIs.
  • Clarified Android API-level support in docs: association APIs require API 26+, while background presence/wake flows require API 31+ (with API 33+ id-based observation path).

0.2.0 #

  • Added CompanionDeviceManager.backgroundEvents for reactive device_appeared/device_disappeared updates.
  • Added Android EventChannel support (companion_device_manager/events) and native event emission from CompanionDeviceBackgroundService.
  • Fixed background stream attachment/detachment race condition: event sink now properly scoped per Flutter engine to avoid conflicts between foreground and headless engines.
  • Fixed SharedPreferences race condition on event persistence by switching from async apply() to synchronous commit() for reliable "Reload last event" behavior.
  • Fixed ServicesBinding initialization error in headless background callback by ensuring WidgetsFlutterBinding.ensureInitialized() and ui.DartPluginRegistrant.ensureInitialized() are called early in flow.
  • Removed duplicate plugin registration in headless Flutter engine to eliminate duplicate registration warnings.
  • Updated the example app to:
    • reactively refresh UI with background events from the stream
    • auto-log new background events
    • display formatted receive timestamp (date/time + relative "time ago" update)
  • Updated README with background callback initialization requirements and example app usage.

0.1.0 #

  • Implemented a real Android-only Companion Device Manager plugin API.
  • Added typed Dart models for association requests, associations, filters, and events.
  • Added method-channel support for availability checks, association, disassociation, and event retrieval.
  • Added background callback registration for wake scenarios using CompanionDeviceService.
  • Added Android native storage for callback handles and last background event payload.
  • Reworked the example app to demonstrate the full association and wake callback flow.
  • Added detailed documentation in doc/ and a pub.dev-style root README.

0.0.1 #

  • Initial template generated by Flutter plugin scaffolding.
1
likes
150
points
105
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Android-only Flutter plugin for Companion Device Manager (CDM) association and wake callbacks

Repository (GitHub)
View/report issues

Topics

#companion-device #android #bluetooth #plugin #background

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on companion_device_manager

Packages that implement companion_device_manager