Use isMultipleAdvertisementSupported
to check whether PeripheralManager
is supported on this device, closes #83 (#85)
* Use `isMultipleAdvertisementSupported` to check whether `PeripheralManager` is supported on this device. * 6.0.2 * 6.0.2 --------- Co-authored-by: yanshouwang <yanshouwang@outlook.com>
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
## 6.0.2
|
||||||
|
|
||||||
|
* `Android` [Use `isMultipleAdvertisementSupported` to check whether `PeripheralManager` is supported on this device.](https://github.com/yanshouwang/bluetooth_low_energy/issues/83).
|
||||||
|
|
||||||
## 6.0.1
|
## 6.0.1
|
||||||
|
|
||||||
* `Android` Fix the issue that [advertisement name is wrong when advertising](https://github.com/yanshouwang/bluetooth_low_energy/issues/62).
|
* `Android` Fix the issue that [advertisement name is wrong when advertising](https://github.com/yanshouwang/bluetooth_low_energy/issues/62).
|
||||||
|
@ -28,10 +28,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: bluetooth_low_energy_android
|
name: bluetooth_low_energy_android
|
||||||
sha256: "97cac5169a392f3872cbb416cc11cf0b2287567c0ceca4d975f2fc5bdd2b1e6f"
|
sha256: f8cbef16b980f96c09df5d1d46b61be9f05683866151440e9987796607a4e7d8
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.2"
|
version: "6.0.3"
|
||||||
bluetooth_low_energy_darwin:
|
bluetooth_low_energy_darwin:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -205,10 +205,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: go_router
|
name: go_router
|
||||||
sha256: "6ad5662b014c06c20fa46ab78715c96b2222a7fe4f87bf77e0289592c2539e86"
|
sha256: cdae1b9c8bd7efadcef6112e81c903662ef2ce105cbd220a04bbb7c3425b5554
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.1.3"
|
version: "14.2.0"
|
||||||
hybrid_logging:
|
hybrid_logging:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -290,10 +290,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: material_symbols_icons
|
name: material_symbols_icons
|
||||||
sha256: b2d3cbc3c42b8a217715b0d97ff03aebb14b2b4592875736e5599c603fb2db7e
|
sha256: a2c78726048c755f0f90fd2b7c8799cd94338e2e9b7ab6498ae56503262c14bc
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2758.0"
|
version: "4.2762.0"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: bluetooth_low_energy
|
name: bluetooth_low_energy
|
||||||
description: "A Flutter plugin for controlling the bluetooth low energy, supports central and peripheral roles."
|
description: "A Flutter plugin for controlling the bluetooth low energy, supports central and peripheral roles."
|
||||||
version: 6.0.1
|
version: 6.0.2
|
||||||
homepage: https://github.com/yanshouwang/bluetooth_low_energy
|
homepage: https://github.com/yanshouwang/bluetooth_low_energy
|
||||||
repository: https://github.com/yanshouwang/bluetooth_low_energy
|
repository: https://github.com/yanshouwang/bluetooth_low_energy
|
||||||
issue_tracker: https://github.com/yanshouwang/bluetooth_low_energy/issues
|
issue_tracker: https://github.com/yanshouwang/bluetooth_low_energy/issues
|
||||||
@ -20,7 +20,7 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
bluetooth_low_energy_platform_interface: ^6.0.0
|
bluetooth_low_energy_platform_interface: ^6.0.0
|
||||||
bluetooth_low_energy_android: ^6.0.2
|
bluetooth_low_energy_android: ^6.0.3
|
||||||
bluetooth_low_energy_darwin: ^6.0.0
|
bluetooth_low_energy_darwin: ^6.0.0
|
||||||
bluetooth_low_energy_windows: ^6.0.0
|
bluetooth_low_energy_windows: ^6.0.0
|
||||||
bluetooth_low_energy_linux: ^6.0.0
|
bluetooth_low_energy_linux: ^6.0.0
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
## 6.0.3
|
||||||
|
|
||||||
|
* [Use `isMultipleAdvertisementSupported` to check whether `PeripheralManager` is supported on this device.](https://github.com/yanshouwang/bluetooth_low_energy/issues/83).
|
||||||
|
|
||||||
## 6.0.2
|
## 6.0.2
|
||||||
|
|
||||||
* Fix the warning issue.
|
* Fix the warning issue.
|
||||||
|
@ -111,7 +111,9 @@ class MyPeripheralManager(context: Context, binaryMessenger: BinaryMessenger) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getState(): MyBluetoothLowEnergyStateArgs {
|
override fun getState(): MyBluetoothLowEnergyStateArgs {
|
||||||
val supported = context.packageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)
|
// Use isMultipleAdvertisementSupported() to check whether LE Advertising is supported on this device before calling this method.
|
||||||
|
// See https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothAdapter#getbluetoothleadvertiser
|
||||||
|
val supported = context.packageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE) && adapter.isMultipleAdvertisementSupported
|
||||||
return if (supported) {
|
return if (supported) {
|
||||||
val authorized = permissions.all { permission -> ActivityCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED }
|
val authorized = permissions.all { permission -> ActivityCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED }
|
||||||
return if (authorized) adapter.state.toBluetoothLowEnergyStateArgs()
|
return if (authorized) adapter.state.toBluetoothLowEnergyStateArgs()
|
||||||
|
@ -15,7 +15,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "6.0.2"
|
version: "6.0.3"
|
||||||
bluetooth_low_energy_platform_interface:
|
bluetooth_low_energy_platform_interface:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: bluetooth_low_energy_android
|
name: bluetooth_low_energy_android
|
||||||
description: "Android implementation of the bluetooth_low_energy plugin."
|
description: "Android implementation of the bluetooth_low_energy plugin."
|
||||||
version: 6.0.2
|
version: 6.0.3
|
||||||
homepage: https://github.com/yanshouwang/bluetooth_low_energy
|
homepage: https://github.com/yanshouwang/bluetooth_low_energy
|
||||||
repository: https://github.com/yanshouwang/bluetooth_low_energy
|
repository: https://github.com/yanshouwang/bluetooth_low_energy
|
||||||
issue_tracker: https://github.com/yanshouwang/bluetooth_low_energy/issues
|
issue_tracker: https://github.com/yanshouwang/bluetooth_low_energy/issues
|
||||||
|
Reference in New Issue
Block a user