Before checking for Bluetooth permissions in code, you must configure the required permissions in each OS of your application.

Android

In Android, the permissions are defined in the manifest.xml file. Add the following permissions depending on the Android version you want to make the application compatible with:

Android 11 and lower:

  • ACCESS_COARSE_LOCATION

  • ACCESS_FINE_LOCATION

  • BLUETOOTH

  • BLUETOOTH_ADMIN

To add previous permissions to your manifest.xml file:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30"/>
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30"/>

Android 12 and greater:

  • BLUETOOTH_CONNECT

  • BLUETOOTH_SCAN (flag it as not for location)

To add previous permissions to your manifest.xml file:

<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/>
If you want to make the application compatible with all Android versions, add all these permissions to the manifest.xml file.

iOS

In iOS, permissions are defined in the info.plist file. Add the following keys there:

  • NSBluetoothAlwaysUsageDescription (Deprecated if the iOS deployment target version is 13 or greater)

  • NSBluetoothPeripheralUsageDescription

To add previous keys to your info.plist file:

<!--Description of the Bluetooth request message (required on iOS 10, deprecated)-->
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Your permission request text here</string>
<!--Description of the Bluetooth request message (required on iOS 13)-->
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Your permission request text here</string>