Location needs to be enabled for Bluetooth Low Energy Scanning on Android 10.0

后端 未结 1 1650
野的像风
野的像风 2021-01-19 16:25

After upgrading my Pixel XL to Android version 10.0 Bluetooth Low Energy (BLE) scanning will only work if i have Location turned on.

This has not been an issue until

相关标签:
1条回答
  • 2021-01-19 17:04

    As of Android 10, it is now required to have ACCESS_FINE_LOCATION turned on in order to perform Bluetooth operations. The reason for this is that Bluetooth can be used to gather information about the location of the user (e.g. using BLE beacons), and for that the relevant app permission should be declared.

    For Android 9 and lower, ACCESS_COARSE_LOCATION is sufficient which is probably why your app was working without an issue.

    More information can be found here:-

    • https://developer.android.com/guide/topics/connectivity/bluetooth#Permissions
    • Bluetooth LE Scan doesn't work on Android M in the background

    I hope this helps.

    0 讨论(0)
提交回复
热议问题