Closed mattijsf closed 2 years ago
@mattijsf it should be resolved in v1.2.0-SNAPSHOT — we introduced LockError.BluetoothUnauthorized
for this case.
Unfortunately prompting for Bluetooth permissions is tied to Activity. That means we would need to introduce a transparent activity or create a possibility to provide an Activity to the library just for this use case. With this new LockError.BluetoothUnauthorized
error, requesting Bluetooth permissions in the app itself should be fairly simple.
LockError.BluetoothUnauthorized
is included in today's v1.2.0 stable release. Feel free to reopen this issue if it's not behaving correctly
On Android 12 when
BLUETOOTH_CONNECT
|BLUETOOTH_SCAN
permissions are not requested, the SDK throws an error when interacting the the SDK lock / unlock APIs:When build with
compileSdkVersion 31 & targetSdkVersion 31
:When build with
compileSdkVersion 31 & targetSdkVersion 30
:With these build configurations running on an Android 12 device causes a different error (depending on the
targetSdkVersion
) when attempting to unlock a bike. In both cases I would expect someBluetoothUnauthorized
type of error, similar to the LockError.BluetoothUnauthorized on LockKit iOS.Sidenote: On iOS the SDK is also prompting for bluetooth permissions in case these are not requested. It would be nice if the Android SDK could follow this behavior on Android 12+ devices.