You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use `BLUETOOTH_SCAN` to determine location, remove `android:usesPermissionFlags="neverForLocation"`
51
+
52
+
If you use location services in your app, remove `android:maxSdkVersion="30"` from the location permission tags
53
+
54
+
### Android ProGuard rules
55
+
In case you are using ProGuard add the following snippet to your `proguard-rules.pro` file:
56
+
57
+
```
58
+
-keep class com.signify.hue.** { *; }
59
+
```
60
+
61
+
This will prevent issues like [#131](https://github.com/PhilipsHue/flutter_reactive_ble/issues/131).
62
+
63
+
### iOS
64
+
65
+
For iOS it is required you add the following entries to the `Info.plist` file of your app. It is not allowed to access Core BLuetooth without this. See [our example app](https://github.com/PhilipsHue/flutter_reactive_ble/blob/master/example/ios/Runner/Info.plist) on how to implement this. For more indepth details: [Blog post on iOS bluetooth permissions](https://medium.com/flawless-app-stories/handling-ios-13-bluetooth-permissions-26c6a8cbb816)
66
+
67
+
iOS13 and higher
68
+
* NSBluetoothAlwaysUsageDescription
69
+
70
+
iOS12 and lower
71
+
* NSBluetoothPeripheralUsageDescription
72
+
73
+
## Usage
21
74
### Initialization
22
75
23
76
Initializing the library should be done the following:
@@ -168,24 +221,6 @@ The Android OS maintains a table per device of the discovered service in cache.
This will prevent issues like [#410](https://github.com/PhilipsHue/flutter_reactive_ble/issues/410).
227
-
228
-
229
-
SDK 31 and up (Android 12+):
230
-
* BLUETOOTH_CONNECT: allows apps to connect to a Bluetooth device
231
-
* BLUETOOTH_SCAN: allows apps to scan for Bluetooth devices
232
-
233
-
These permissions are already added in the manifest of this library and thus should automatically merge
234
-
into the manifest of your app. It is not needed to add the permissions in your manifest.
235
-
236
-
Only when using Android SDK 31 (Android 12) and higher please make sure you manifest is correctly setup
237
-
regarding `android:usesPermissionFlags="neverForLocation"` for the `android:name="android.permission.BLUETOOTH_SCAN"` permission,
238
-
depending on the use cases of your app. See [This link](https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#declare-android12-or-higher)
239
-
for more information and [the manifest of the example app](https://github.com/PhilipsHue/flutter_reactive_ble/blob/master/example/android/app/src/main/AndroidManifest.xml) for an example usage.
240
-
241
-
**iOS**
242
-
243
-
For iOS it is required you add the following entries to the `Info.plist` file of your app. It is not allowed to access Core BLuetooth without this. See [our example app](https://github.com/PhilipsHue/flutter_reactive_ble/blob/master/example/ios/Runner/Info.plist) on how to implement this. For more indepth details: [Blog post on iOS bluetooth permissions](https://medium.com/flawless-app-stories/handling-ios-13-bluetooth-permissions-26c6a8cbb816)
244
-
245
-
iOS13 and higher
246
-
* NSBluetoothAlwaysUsageDescription
247
-
248
-
iOS12 and lower
249
-
* NSBluetoothPeripheralUsageDescription
250
-
251
-
#### How to adjust ProGuard (Android)
252
-
253
-
In case you are using ProGuard add the following snippet to your `proguard-rules.pro` file:
254
-
255
-
```
256
-
-keep class com.signify.hue.** { *; }
257
-
```
258
-
259
-
This will prevent issues like [#131](https://github.com/PhilipsHue/flutter_reactive_ble/issues/131).
260
-
261
246
#### Why doesn't the BLE stack directly connect to my peripheral
262
247
263
248
Before you are able to execute BLE operations the BLE-stack of the device makes sure everything is setup correctly and then reports ready for operation. For some devices this takes a bit longer than for others. When starting the app make sure that the BLE-stack is properly initialized before you execute BLE operations. The safest way to do this is by listening to the `statusStream` and wait for `BleStatus.ready`.
@@ -266,4 +251,4 @@ This will prevent issues like [#147](https://github.com/PhilipsHue/flutter_react
266
251
267
252
#### Unofficial example apps
268
253
269
-
Example implementation UART over BLE:[link](https://github.com/wolfc01/flutter_reactive_ble_uart_example)
254
+
Example implementation UART over BLE:[link](https://github.com/wolfc01/flutter_reactive_ble_uart_example)
If you use `BLUETOOTH_SCAN` to determine location, remove `android:usesPermissionFlags="neverForLocation"`
33
+
34
+
If you use location services in your app, remove `android:maxSdkVersion="30"` from the location permission tags
35
+
36
+
### Android ProGuard rules
37
+
In case you are using ProGuard add the following snippet to your `proguard-rules.pro` file:
38
+
39
+
```
40
+
-keep class com.signify.hue.** { *; }
41
+
```
42
+
43
+
This will prevent issues like [#131](https://github.com/PhilipsHue/flutter_reactive_ble/issues/131).
44
+
45
+
### iOS
46
+
47
+
For iOS it is required you add the following entries to the `Info.plist` file of your app. It is not allowed to access Core BLuetooth without this. See [our example app](https://github.com/PhilipsHue/flutter_reactive_ble/blob/master/example/ios/Runner/Info.plist) on how to implement this. For more indepth details: [Blog post on iOS bluetooth permissions](https://medium.com/flawless-app-stories/handling-ios-13-bluetooth-permissions-26c6a8cbb816)
48
+
49
+
iOS13 and higher
50
+
* NSBluetoothAlwaysUsageDescription
51
+
52
+
iOS12 and lower
53
+
* NSBluetoothPeripheralUsageDescription
54
+
55
+
## Usage
21
56
### Initialization
22
57
23
58
Initializing the library should be done the following:
Use ` _ble.status` to get the current status of the host device.
56
91
57
-
See [BleStatus](https://github.com/PhilipsHue/flutter_reactive_ble/blob/master/lib/src/model/ble_status.dart) for
92
+
See [BleStatus](https://github.com/PhilipsHue/flutter_reactive_ble/blob/master/packages/reactive_ble_platform_interface/lib/src/model/ble_status.dart) for
58
93
more info about the meaning of the different statuses.
For android the library uses the following permissions:
197
-
* ACCESS_FINE_LOCATION : this permission is needed because old Nexus devices need location services in order to provide reliable scan results
198
-
* BLUETOOTH : allows apps to connect to a paired bluetooth device
199
-
* BLUETOOTH_ADMIN: allows apps to discover and pair bluetooth devices
200
-
201
-
These permissions are already added in the manifest of the this library and thus should automatically merge
202
-
into the manifest of your app. It is not needed to add the permissions in your manifest.
203
-
204
-
**iOS**
205
-
206
-
For iOS it is required you add the following entries to the `Info.plist` file of your app. It is not allowed to access Core BLuetooth without this. See [our example app](https://github.com/PhilipsHue/flutter_reactive_ble/blob/master/example/ios/Runner/Info.plist) on how to implement this. For more indepth details: [Blog post on iOS bluetooth permissions](https://medium.com/flawless-app-stories/handling-ios-13-bluetooth-permissions-26c6a8cbb816)
207
-
208
-
iOS13 and higher
209
-
* NSBluetoothAlwaysUsageDescription
210
-
211
-
iOS12 and lower
212
-
* NSBluetoothPeripheralUsageDescription
213
-
214
-
#### How to adjust ProGuard (Android)
215
-
216
-
In case you are using ProGuard add the following snippet to your `proguard-rules.pro` file:
217
-
218
-
```
219
-
-keep class com.signify.hue.** { *; }
220
-
```
221
-
222
-
This will prevent issues like [#131](https://github.com/PhilipsHue/flutter_reactive_ble/issues/131).
223
-
224
228
#### Why doesn't the BLE stack directly connect to my peripheral
225
229
226
230
Before you are able to execute BLE operations the BLE-stack of the device makes sure everything is setup correctly and then reports ready for operation. For some devices this takes a bit longer than for others. When starting the app make sure that the BLE-stack is properly initialized before you execute BLE operations. The safest way to do this is by listening to the `statusStream` and wait for `BleStatus.ready`.
0 commit comments