Skip to content

Commit 1ef4708

Browse files
authored
doc(readme): android 12 ble scan for location (#554)
1 parent 4b5ed35 commit 1ef4708

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,21 @@ The reactive BLE lib supports the following:
4040
### Android
4141

4242
You need to add the following permissions to your AndroidManifest.xml file:
43+
4344
```xml
4445
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
4546
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
4647
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />
4748
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />
4849
```
4950

50-
If you use `BLUETOOTH_SCAN` to determine location, remove `android:usesPermissionFlags="neverForLocation"`
51+
If you use `BLUETOOTH_SCAN` to determine location, modify your AndroidManfiest.xml file to include the following entry:
52+
53+
```xml
54+
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
55+
tools:remove="android:usesPermissionFlags"
56+
tools:targetApi="s" />
57+
```
5158

5259
If you use location services in your app, remove `android:maxSdkVersion="30"` from the location permission tags
5360

packages/flutter_reactive_ble/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,21 @@ The reactive BLE lib supports the following:
2222
### Android
2323

2424
You need to add the following permissions to your AndroidManifest.xml file:
25+
2526
```xml
2627
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
2728
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
2829
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />
2930
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />
3031
```
3132

32-
If you use `BLUETOOTH_SCAN` to determine location, remove `android:usesPermissionFlags="neverForLocation"`
33+
If you use `BLUETOOTH_SCAN` to determine location, modify your AndroidManfiest.xml file to include the following entry:
34+
35+
```xml
36+
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
37+
tools:remove="android:usesPermissionFlags"
38+
tools:targetApi="s" />
39+
```
3340

3441
If you use location services in your app, remove `android:maxSdkVersion="30"` from the location permission tags
3542

0 commit comments

Comments
 (0)