flutter_ble_peripheral 3.0.0 copy "flutter_ble_peripheral: ^3.0.0" to clipboard
flutter_ble_peripheral: ^3.0.0 copied to clipboard

This plugin enables a device to be set into peripheral mode, and advertise custom services and characteristics.

Changelog #

3.0.0 - 2026-09-02 #

⚠ BREAKING CHANGES #

Advertising was split into a shared core plus one settings object per platform, so a call site no longer mixes fields that only one platform honours with fields every platform honours. The README has the full before/after.

  • AdvertiseData is removed. Use AdvertiseDataCore for the cross-platform fields or AndroidAdvertiseData for the Android-only ones, and includeTxPowerLevel in place of includePowerLevel (#301, #314)
  • start(advertiseSettings:), start(advertiseSetParameters:), start(advertiseResponseData:), start(advertisePeriodicData:) and start(periodicAdvertiseSettings:) are removed. Pass start(androidSettings: AndroidAdvertiseSettings(...)), which holds all five; advertisePeriodicData is periodicAdvertiseData there. DarwinAdvertiseSettings and WindowsAdvertiseSettings are the equivalents for the other platforms (#301)
  • AdvertiseSettings.advertiseSet is removed. Passing AndroidAdvertiseSettings.advertiseSetParameters selects the extended advertising API, and is now mutually exclusive with advertiseSettings, where 2.x took both and let advertiseSet pick (#301)
  • PermissionState is removed. Use PeripheralBluetoothState, which covers the same permission cases plus the adapter states. There is deliberately no alias: the two declare their entries in a different order and the values cross the platform channel by ordinal, so mapping the old values across by index would give the wrong state rather than a compile error (#301)
  • BluetoothPeripheralState is renamed to PeripheralBluetoothState, so this package and flutter_ble_central no longer declare colliding type names. The old name stays as a deprecated alias in 3.0 and is removed in the next breaking release (#316)
  • AdvertiseSettings defaults changed: timeout is 0, meaning no timeout, instead of 400, and txPowerLevel is advertiseTxPowerHigh instead of advertiseTxPowerLow (#301)
  • AdvertiseSetParameters.anonymous is a bool?, not an int? (#289)
  • PeripheralState carries locationServicesDisabled again, which shifts the index of every entry after it. Switch on the values, not on .values[i] (#301)
  • The files under lib/src moved into core/ and platform/<platform>/. Only a direct package:flutter_ble_peripheral/src/... import breaks; everything is still exported from package:flutter_ble_peripheral/flutter_ble_peripheral.dart (#301)

Features #

  • add a gatt server with tx and rx characteristics (#260) (bea5601)
  • windows: serve a gatt server with tx and rx characteristics (#302) (fe76ede)
  • split the advertising api into core and per-platform settings (#301) (b88abee)
  • remove the deprecated AdvertiseData (#314) (26fcfdb)
  • keep the old state name as a deprecated alias (#316) (dc3c389)
  • honour the advertise timeout on windows (#299) (0260ef8)
  • add the peripheral half of the interop harness (#308) (90e2e10)
  • rebuild the example app and add pong over the gatt link (#311) (67cdff0)

Bug Fixes #

  • android service uuids not broadcasting (#285) (b107d15)
  • apply tx power flags and send periodic advertise data on android (#293) (079274c)
  • read advertise byte payloads without casting to ByteArray (#287) (4832965)
  • send the android advertising results from the main thread (#300) (776aa4a)
  • set advertiseResponseData correctly on Android (#269) (0e84738)
  • apple: report peripheral support from core bluetooth, not beacon monitoring (#309) (76e6405)
  • apple: report the att mtu rather than the notification payload size (#304) (adfa9d7)
  • validate service uuids and advertise once powered on, on apple (#290) (3135668)
  • build the full advertisement payload on windows (#297) (881ed5b)
  • correct the windows state reporting and plugin teardown (#298) (20b81c9)
  • windows: align the peripheral state values with the dart enum (#303) (01e65aa)
  • windows: stop a failed radio read from taking the process down (#307) (0c819cd)
  • windows: wait for the radio lookup before answering isSupported (#310) (16d8c3a)
  • keep isAdvertising true while a central is connected (#305) (ffe46b4)
  • only offer a local name where the platform broadcasts one (#312) (11ea402)
  • return the advertising state from start on every platform (#292) (3f0be35)
  • return the converted map from Uint8ListMapStringConverter.toJson (#295) (6473056)
  • type AdvertiseSetParameters.anonymous as a bool (#289) (612ec8d)
  • example: defer link meter reports made while the tree is locked (#313) (fab6ddc)

2.1.1 #

Fixes #

  • [Windows] Fixed crash when Bluetooth adapter is not present or Bluetooth is disabled
  • [Windows] Added comprehensive exception handling throughout the plugin to prevent crashes from WinRT API failures
  • [Windows] Fixed initial state reporting to correctly show unsupported when no Bluetooth adapter is available
  • [Windows] Fixed potential crash from type mismatches in method call arguments

2.1.0 #

New Features #

  • [iOS/macOS] Added isBluetoothOn to check Bluetooth power state
  • [iOS/macOS] Added hasPermission using CBPeripheralManager.authorization API
  • [iOS/macOS] Added requestPermission support (returns current state, as permissions are implicit on Apple)
  • [iOS/macOS] Added openBluetoothSettings that opens Bluetooth settings directly
  • [Android] Added isBluetoothOn to check Bluetooth power state
  • [Android] Added Bluetooth state change listener - UI now updates when Bluetooth is toggled while app is open
  • [Dart] hasPermission() and requestPermission() now work on iOS/macOS (previously returned unknown)

Improvements #

  • [iOS/macOS] isSupported now uses peripheral manager state instead of iBeacon check
  • [iOS/macOS] Permission and Bluetooth state are now properly separated (permission can be checked regardless of power state)
  • [Example] Complete redesign with Material 3 UI
  • [Example] Added comprehensive startup checks for: BLE support, permissions, Bluetooth state
  • [Example] Platform-specific permission dialogs (Apple shows Settings only, Android shows Grant button)
  • [Example] Android permission dialog updates when permanently denied
  • [Example] Bluetooth off dialog hides "Turn On" button on Apple (not supported)
  • [Windows] Updated build configuration

Fixes #

  • [iOS/macOS] enableBluetooth now properly returns false (not supported on Apple platforms)

2.0.1 #

Fixes naming issues

2.0.0 #

  • [Android] Update java and minsdk to latest
  • [Apple] Merge of ios and macos codebase
  • Complete rewrite of permission system

1.2.6 #

  • [Android] Fixes error on start broadcasting

1.2.5 #

  • [Android] Added advertiseSet parameter to AdvertiseSettings to enable advertiseSet on Android o and higher devices.

1.2.4 #

  • [iOS & macOS] Fixed an issue which caused the first advertisement not to be broadcast.

1.2.3 #

  • [Android] Fixed requestPermission not working correctly.

1.2.2 #

  • [Android] Fixed serviceUuid not working. (thanks @Shik1266 !)
  • [Android] Updated compileSdk to 34.

1.2.1 #

  • Fix build errors & crash on Windows
  • Upgrade gradle to 8.1

1.2.0 #

Improvements:

  • Added support for windows
  • Updated bluetooth permissions system for Android, no need for permission handler anymore.
  • Updated dependencies and several other small improvements.

1.1.1 #

Bugs fixed:

  • Fixed an issue which caused the enableBluetooth function to reply twice.
  • Fixed analyzer issues
  • Upgraded dependencies

1.1.0 #

Upgraded android sdk to 33. Added permission check on enableBluetooth function.

1.0.0 #

Stable release including the changes noted in the beta releases. This release also updates Android dependencies.

1.0.0-beta.2 #

Fixed macOS version not working

1.0.0-beta.1 #

BREAKING CHANGES: You now define the data to be advertised using the AdvertiseData() constructor. AdvertiseData is the only supported object in iOS. AdvertiseSettings and other objects are only supported on Android.

NEW:

  • You can now make use of the new startAdvertisingSet parameter on Android 26+

0.6.0 #

  • Refactored large parts of the code for both Android & iOS.
  • Upgraded Android to Android 12 permission system.
  • Other minor improvements

0.5.0+1 #

Changes of 0.5.0 weren't visible on pub.dev

0.5.0 #

Added isSupported function to check if BLE advertising is supported by the device.

0.4.2 #

Fixed typo causing deviceName not to broadcast on iOS

0.4.1 #

Fixed bug on iOS which led to crash Added local name to advertising in iOS Updated Android dependencies

0.4.0 #

Added new options to AdvertiseData Removed embedding V1 for Android

0.3.0 #

Upgraded to null-safety Updated dependencies Changed to pedantic

Bug fixes

  • Fixed null-pointer when bluetooth adapter isn't found

0.2.0 #

Add support for MacOS

0.1.0 #

Fixed several parts for Android:

  • Advertising local name
  • Advertising Manufacturer Data
  • Advertising Service Data

0.0.4 #

Fixed iOS advertising not working

0.0.3 #

Fixed callback on Android

0.0.2 #

Fixed flutter v2 embedding

0.0.1 #

Initial version of the library. This version includes:

  • broadcasting a custom UUID
64
likes
160
points
3.93k
downloads

Documentation

API reference

Publisher

verified publishersteenbakker.dev

Weekly Downloads

This plugin enables a device to be set into peripheral mode, and advertise custom services and characteristics.

Repository (GitHub)
View/report issues
Contributing

License

BSD-3-Clause (license)

Dependencies

flutter, json_annotation

More

Packages that depend on flutter_ble_peripheral

Packages that implement flutter_ble_peripheral