Reedyuk / blue-falcon

A Bluetooth kotlin multiplatform "Cross-Platform" library for iOS and Android
https://bluefalcon.dev
Apache License 2.0
321 stars 43 forks source link

Runtime Permissions not acquired for BLUETOOTH_CONNECT #111

Closed ndipatri closed 7 months ago

ndipatri commented 9 months ago

Describe the bug

On a Android 13 (Tiramisu) phone, runtime permissions are required for BLUETOOTH_CONNECT. Therefore, if you launch the app on this phone and attempt to connect to a BT device, you will get an app crash and this exception:

_Caused by: java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT permission for AttributionSource { uid = 10408, packageName = dev.bluefalcon, attributionTag = null, token = android.os.BinderProxy@5607825, next = null }: GattService registerClient_

To Reproduce Steps to reproduce the behavior:

  1. Install the app on a Android 13 (Tiramisu) phone.
  2. Launch the app.
  3. Wait for BT devices to show up.
  4. Click on a BT device.
  5. Observe the app crashes.

Expected behavior A clear and concise description of what you expected to happen.z

Upon clicking on a BT device, the app should successfully perform a BT CONNECT operation.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.