androidibeaconibeacon-android

Why android Ibeacon need bluetooth permission?


I am using the android (org.altbeacon:android-beacon-library:2.19.3) library providing APIs to interact with Beacons

It has required Location & Bluetooth permission.

Permission Requirements:

https://altbeacon.github.io/android-beacon-library/requesting_permission.html

IOS's ibeacon does not require Bluetooth permission, why does android ibeacon need Bluetooth permission?

is there any alternate library for android Ibeacon


Solution

  • Yes, Android requires Bluetooth permission to scan for bluetooth beacons but iOS does not require the same permission to detect iBeacon. The requirement for Android to have Bluetooth permission to scan for beacons is true regardless of the library you use. It is an OS platform restriction.

    enter image description here

    The reason why Android requires this permission and iOS does not is based on history of how the two platforms evolved. A few points:

    One important thing to note: Apple not needing Bluetooth permission to detect beacons only applies to the iBeacon format. If you try to detect AltBeacon or Eddystone you actually do need the Bluetooth permission (and not the Location permission for those formats.) This is a "loophole" that is useful for avoiding extra permissions in some cases on iOS devices.

    One final note: Starting with Android 12, there is a new BLUETOOTH_SCAN permission that you can use instead of location permission. The idea is to make it so Android no longer requires location permission to scan for regular Bluetooth devices. But there is a big catch: to use this new permission, you must declare in your AndroidManifest.xml that your app does not use Bluetooth for location purposes (e.g. beacons) and Android says it will filter out some scan results in these cases. They don't say explicitly, but that probably means they will filter out any Bluetooth packet matching a known beacon format like iBeacon, AltBeacon or Eddystone.