nativescript-community / nativescript-community/ble

Scan throws error on android 13+

Open
#276 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
202
Forks
79
PR merge metrics
No merged PRs in 30d

Description

It seems that android 13+ devices need an additional permission for BLE scan.
Error log:

Error: java.lang.SecurityException: Permission Denial: starting Intent { act=android.bluetooth.adapter.action.REQUEST_ENABLE cmp=com.android.settings/.bluetooth.RequestPermissionActivity } from ProcessRecord{e7d2f4d 5142:com.fuelics.mobile.alpha/u0a159} (pid=5142, uid=10159) requires android.permission.BLUETOOTH_CONNECT undefined

Google claimed that this permission was useful for devices that were already paired in API 31 https://developer.android.com/develop/connectivity/bluetooth/bt-permissions. That doesn't seem to be the case anymore.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Android BLE scan and permission entry point, then reproduce the reported SecurityException on an Android 13+ device. Done means the scan flow no longer throws the BLUETOOTH_CONNECT denial. No file or test is named in the issue, so locate the relevant implementation and existing test coverage first.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, typescript
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.