Skip to content

Commit

Permalink
ask ACCESS_COARSE_LOCATION permission on older Android versions
Browse files Browse the repository at this point in the history
  • Loading branch information
alerighi committed Jan 10, 2025
1 parent fddc3c5 commit 67da68f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions library/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@

<!-- these permissions are required for Android <= 11 -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public BlePermissionsManager(ReactApplicationContext context) {
this.permissions.add(Manifest.permission.BLUETOOTH);
this.permissions.add(Manifest.permission.BLUETOOTH_ADMIN);
this.permissions.add(Manifest.permission.ACCESS_FINE_LOCATION);
this.permissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);
}
}

Expand All @@ -54,7 +55,7 @@ private List<String> getMissingPermissions() {
@Override
public void ensure(PermissionManagerCheckCallback callback) {
List<String> missingPermissions = getMissingPermissions();
if (missingPermissions.size() == 0) {
if (missingPermissions.isEmpty()) {
Log.i(TAG, "all permissions granted :)");
callback.onPermissionResponse(true);
} else {
Expand Down

0 comments on commit 67da68f

Please sign in to comment.