Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 13 ACCESS_COARSE_LOCATION blog/code contradiction #23

Open
blundell opened this issue Aug 27, 2024 · 1 comment
Open

Android 13 ACCESS_COARSE_LOCATION blog/code contradiction #23

blundell opened this issue Aug 27, 2024 · 1 comment

Comments

@blundell
Copy link

Your docs state:

ACCESS_COARSE_LOCATION: Apps targeting Android 12 (API 31) and above must also request this permission in addition to ACCESS_FINE_LOCATION.

image

However your code only requests the SCAN permission: https://github.com/PunchThrough/ble-starter-android/blob/api-34/app/src/main/java/com/punchthrough/blestarterappandroid/PermissionsHelper.kt#L44

I've been able to reproduce in my app that I cannot scan and find any BT devices unless the COARSE location permission is granted. I'm running on a Pixel 7 / Android 13.

Is this something you are aware of?

@blundell
Copy link
Author

seems if you miss the android:usesPermissionFlags="neverForLocation" from the BLUETOOTH_SCAN permission then you have to request FINE_LOCATION access

<uses-permission
        android:name="android.permission.BLUETOOTH_SCAN"
        android:usesPermissionFlags="neverForLocation"
        />

perhaps you could explain that in your doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant