@capgo/capacitor-bluetooth-low-energy 8.2.11 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapgoCapacitorBluetoothLowEnergy.podspec +1 -1
- package/Package.swift +3 -4
- package/README.md +20 -6
- package/android/build.gradle +9 -12
- package/android/proguard-rules.pro +21 -0
- package/android/src/main/java/ee/forgr/plugin/bluetooth_low_energy/BluetoothLowEnergyPlugin.java +1 -1
- package/dist/docs.json +3 -3
- package/dist/esm/definitions.d.ts +3 -3
- package/ios/Sources/BluetoothLowEnergyPlugin/BluetoothLowEnergyPlugin.swift +1 -1
- package/package.json +8 -7
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.ios.deployment_target = '16.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.swift_version = '5.1'
|
|
17
17
|
end
|
package/Package.swift
CHANGED
|
@@ -3,21 +3,20 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapgoCapacitorBluetoothLowEnergy",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v16)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapgoCapacitorBluetoothLowEnergy",
|
|
10
10
|
targets: ["BluetoothLowEnergyPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor.git", from: "9.0.0")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
|
17
17
|
name: "BluetoothLowEnergyPlugin",
|
|
18
18
|
dependencies: [
|
|
19
|
-
.product(name: "Capacitor", package: "capacitor
|
|
20
|
-
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
19
|
+
.product(name: "Capacitor", package: "capacitor")
|
|
21
20
|
],
|
|
22
21
|
path: "ios/Sources/BluetoothLowEnergyPlugin"),
|
|
23
22
|
.testTarget(
|
package/README.md
CHANGED
|
@@ -61,12 +61,26 @@ The most complete doc is available here: https://capgo.app/docs/plugins/bluetoot
|
|
|
61
61
|
|
|
62
62
|
| Plugin version | Capacitor compatibility | Maintained |
|
|
63
63
|
| -------------- | ----------------------- | ---------- |
|
|
64
|
-
|
|
|
64
|
+
| v9.\*.\* | v9.\*.\* | ✅ |
|
|
65
|
+
| v8.\*.\* | v8.\*.\* | On demand |
|
|
65
66
|
| v7.\*.\* | v7.\*.\* | On demand |
|
|
66
67
|
| v6.\*.\* | v6.\*.\* | ❌ |
|
|
67
68
|
| v5.\*.\* | v5.\*.\* | ❌ |
|
|
68
69
|
|
|
69
|
-
> **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin
|
|
70
|
+
> **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v9 for Capacitor 9). Only the latest major version is actively maintained.
|
|
71
|
+
|
|
72
|
+
## Migrating from v8 to v9
|
|
73
|
+
|
|
74
|
+
v9 of `@capgo/capacitor-bluetooth-low-energy` targets Capacitor 9. Update Capacitor and this plugin together, then sync the native projects:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm install @capacitor/core@^9.0.0 @capacitor/cli@^9.0.0 @capacitor/ios@^9.0.0 @capacitor/android@^9.0.0 @capgo/capacitor-bluetooth-low-energy@^9.0.0
|
|
78
|
+
npx cap sync
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Capacitor 9 needs Node.js 24+, iOS 16+ (Xcode 27) and Android minSdk 26 / compileSdk 37. Follow the official [Capacitor 9 update guide](https://capacitorjs.com/docs/updating/9-0) for the app side changes.
|
|
82
|
+
|
|
83
|
+
No plugin API was removed: the JavaScript API of v9 is the same as v8.
|
|
70
84
|
|
|
71
85
|
## Install
|
|
72
86
|
|
|
@@ -939,7 +953,7 @@ Add a listener for Bluetooth adapter power state changes.
|
|
|
939
953
|
|
|
940
954
|
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>></code>
|
|
941
955
|
|
|
942
|
-
**Since:** 8.
|
|
956
|
+
**Since:** 8.2.11
|
|
943
957
|
|
|
944
958
|
--------------------
|
|
945
959
|
|
|
@@ -1499,9 +1513,9 @@ Event emitted when a central disconnects from the local GATT server.
|
|
|
1499
1513
|
|
|
1500
1514
|
Event emitted when the Bluetooth adapter is turned on or off.
|
|
1501
1515
|
|
|
1502
|
-
| Prop | Type | Description | Since
|
|
1503
|
-
| ------------- | -------------------- | -------------------------------------------------- |
|
|
1504
|
-
| **`enabled`** | <code>boolean</code> | Whether Bluetooth is enabled (adapter powered on). | 8.
|
|
1516
|
+
| Prop | Type | Description | Since |
|
|
1517
|
+
| ------------- | -------------------- | -------------------------------------------------- | ------ |
|
|
1518
|
+
| **`enabled`** | <code>boolean</code> | Whether Bluetooth is enabled (adapter powered on). | 8.2.11 |
|
|
1505
1519
|
|
|
1506
1520
|
|
|
1507
1521
|
#### GattCharacteristicReadRequestEvent
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
|
-
junitVersion =
|
|
3
|
-
androidxJunitVersion =
|
|
4
|
-
androidxEspressoCoreVersion =
|
|
5
|
-
androidxAppCompatVersion =
|
|
2
|
+
junitVersion = rootProject.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxJunitVersion = rootProject.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
4
|
+
androidxEspressoCoreVersion = rootProject.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
5
|
+
androidxAppCompatVersion = rootProject.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.8.0'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -11,7 +11,7 @@ buildscript {
|
|
|
11
11
|
google()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:
|
|
14
|
+
classpath 'com.android.tools.build:gradle:9.4.1'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -19,12 +19,10 @@ apply plugin: 'com.android.library'
|
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
21
|
namespace = "ee.forgr.plugin.bluetooth_low_energy"
|
|
22
|
-
compileSdk =
|
|
22
|
+
compileSdk = rootProject.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 37
|
|
23
23
|
defaultConfig {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
versionCode 1
|
|
27
|
-
versionName "1.0"
|
|
24
|
+
consumerProguardFiles "proguard-rules.pro"
|
|
25
|
+
minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 26
|
|
28
26
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
29
27
|
}
|
|
30
28
|
buildTypes {
|
|
@@ -49,7 +47,6 @@ android {
|
|
|
49
47
|
|
|
50
48
|
repositories {
|
|
51
49
|
google()
|
|
52
|
-
jcenter()
|
|
53
50
|
mavenCentral()
|
|
54
51
|
}
|
|
55
52
|
|
|
@@ -61,7 +58,7 @@ dependencies {
|
|
|
61
58
|
testImplementation "junit:junit:$junitVersion"
|
|
62
59
|
testImplementation "androidx.test:core:1.6.1"
|
|
63
60
|
testImplementation "org.mockito:mockito-core:5.14.2"
|
|
64
|
-
testImplementation "org.robolectric:robolectric:4.
|
|
61
|
+
testImplementation "org.robolectric:robolectric:4.18"
|
|
65
62
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
66
63
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
67
64
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# You can control the set of applied configuration files using the
|
|
3
|
+
# proguardFiles setting in build.gradle.
|
|
4
|
+
#
|
|
5
|
+
# For more details, see
|
|
6
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
|
+
|
|
8
|
+
# If your project uses WebView with JS, uncomment the following
|
|
9
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
10
|
+
# class:
|
|
11
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
12
|
+
# public *;
|
|
13
|
+
#}
|
|
14
|
+
|
|
15
|
+
# Uncomment this to preserve the line number information for
|
|
16
|
+
# debugging stack traces.
|
|
17
|
+
#-keepattributes SourceFile,LineNumberTable
|
|
18
|
+
|
|
19
|
+
# If you keep the line number information, uncomment this to
|
|
20
|
+
# hide the original source file name.
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
package/android/src/main/java/ee/forgr/plugin/bluetooth_low_energy/BluetoothLowEnergyPlugin.java
CHANGED
|
@@ -79,7 +79,7 @@ import java.util.UUID;
|
|
|
79
79
|
)
|
|
80
80
|
public class BluetoothLowEnergyPlugin extends Plugin {
|
|
81
81
|
|
|
82
|
-
private final String pluginVersion = "
|
|
82
|
+
private final String pluginVersion = "9.0.0";
|
|
83
83
|
private BluetoothManager bluetoothManager;
|
|
84
84
|
private BluetoothAdapter bluetoothAdapter;
|
|
85
85
|
private BluetoothLeScanner bluetoothLeScanner;
|
package/dist/docs.json
CHANGED
|
@@ -1422,7 +1422,7 @@
|
|
|
1422
1422
|
},
|
|
1423
1423
|
{
|
|
1424
1424
|
"name": "since",
|
|
1425
|
-
"text": "8.
|
|
1425
|
+
"text": "8.2.11"
|
|
1426
1426
|
}
|
|
1427
1427
|
],
|
|
1428
1428
|
"docs": "Add a listener for Bluetooth adapter power state changes.",
|
|
@@ -3533,7 +3533,7 @@
|
|
|
3533
3533
|
"docs": "Event emitted when the Bluetooth adapter is turned on or off.",
|
|
3534
3534
|
"tags": [
|
|
3535
3535
|
{
|
|
3536
|
-
"text": "8.
|
|
3536
|
+
"text": "8.2.11",
|
|
3537
3537
|
"name": "since"
|
|
3538
3538
|
}
|
|
3539
3539
|
],
|
|
@@ -3543,7 +3543,7 @@
|
|
|
3543
3543
|
"name": "enabled",
|
|
3544
3544
|
"tags": [
|
|
3545
3545
|
{
|
|
3546
|
-
"text": "8.
|
|
3546
|
+
"text": "8.2.11",
|
|
3547
3547
|
"name": "since"
|
|
3548
3548
|
}
|
|
3549
3549
|
],
|
|
@@ -536,7 +536,7 @@ export interface BluetoothLowEnergyPlugin {
|
|
|
536
536
|
* @param eventName - The event name
|
|
537
537
|
* @param listenerFunc - The listener function
|
|
538
538
|
* @returns Promise that resolves with a handle to remove the listener
|
|
539
|
-
* @since 8.
|
|
539
|
+
* @since 8.2.11
|
|
540
540
|
*/
|
|
541
541
|
addListener(eventName: 'adapterStateChanged', listenerFunc: (event: AdapterStateChangedEvent) => void): Promise<PluginListenerHandle>;
|
|
542
542
|
/**
|
|
@@ -1554,13 +1554,13 @@ export interface CentralDisconnectedEvent {
|
|
|
1554
1554
|
/**
|
|
1555
1555
|
* Event emitted when the Bluetooth adapter is turned on or off.
|
|
1556
1556
|
*
|
|
1557
|
-
* @since 8.
|
|
1557
|
+
* @since 8.2.11
|
|
1558
1558
|
*/
|
|
1559
1559
|
export interface AdapterStateChangedEvent {
|
|
1560
1560
|
/**
|
|
1561
1561
|
* Whether Bluetooth is enabled (adapter powered on).
|
|
1562
1562
|
*
|
|
1563
|
-
* @since 8.
|
|
1563
|
+
* @since 8.2.11
|
|
1564
1564
|
*/
|
|
1565
1565
|
enabled: boolean;
|
|
1566
1566
|
}
|
|
@@ -5,7 +5,7 @@ import CoreBluetooth
|
|
|
5
5
|
// swiftlint:disable type_body_length file_length
|
|
6
6
|
@objc(BluetoothLowEnergyPlugin)
|
|
7
7
|
public class BluetoothLowEnergyPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
8
|
-
private let pluginVersion: String = "
|
|
8
|
+
private let pluginVersion: String = "9.0.0"
|
|
9
9
|
public let identifier = "BluetoothLowEnergyPlugin"
|
|
10
10
|
public let jsName = "BluetoothLowEnergy"
|
|
11
11
|
public let pluginMethods: [CAPPluginMethod] = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-bluetooth-low-energy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Bluetooth Low Energy (BLE) plugin for Capacitor with support for scanning, connecting, reading, writing, and notifications.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"ios/Sources",
|
|
14
14
|
"ios/Tests",
|
|
15
15
|
"Package.swift",
|
|
16
|
-
"CapgoCapacitorBluetoothLowEnergy.podspec"
|
|
16
|
+
"CapgoCapacitorBluetoothLowEnergy.podspec",
|
|
17
|
+
"android/proguard-rules.pro"
|
|
17
18
|
],
|
|
18
19
|
"author": "Martin Donadieu <martin@capgo.app>",
|
|
19
20
|
"license": "MPL-2.0",
|
|
@@ -55,11 +56,11 @@
|
|
|
55
56
|
"changelog:ai": "node scripts/generate-ai-changelog.mjs"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
|
-
"@capacitor/android": "^
|
|
59
|
-
"@capacitor/cli": "^
|
|
60
|
-
"@capacitor/core": "^
|
|
59
|
+
"@capacitor/android": "^9.0.0",
|
|
60
|
+
"@capacitor/cli": "^9.0.0",
|
|
61
|
+
"@capacitor/core": "^9.0.0",
|
|
61
62
|
"@capacitor/docgen": "^0.3.1",
|
|
62
|
-
"@capacitor/ios": "^
|
|
63
|
+
"@capacitor/ios": "^9.0.0",
|
|
63
64
|
"@ionic/eslint-config": "^0.5.0",
|
|
64
65
|
"@ionic/prettier-config": "^4.0.0",
|
|
65
66
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
"prettier-pretty-check": "^0.2.0"
|
|
77
78
|
},
|
|
78
79
|
"peerDependencies": {
|
|
79
|
-
"@capacitor/core": "
|
|
80
|
+
"@capacitor/core": "^9.0.0"
|
|
80
81
|
},
|
|
81
82
|
"prettier": "@ionic/prettier-config",
|
|
82
83
|
"swiftlint": "@ionic/swiftlint-config",
|