Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Bluetooth (Chrome Ubuntu) Scanning #704

Open
vicatcu opened this issue Oct 24, 2024 · 1 comment
Open

Web Bluetooth (Chrome Ubuntu) Scanning #704

vicatcu opened this issue Oct 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@vicatcu
Copy link

vicatcu commented Oct 24, 2024

Describe the bug
I get a permission prompt when i initiate a Bluetooth scan using BleClient.requestLEScan but

To Reproduce
Steps to reproduce the behavior:
Do all the pre-requisite enablement of experimental features in chrome://flags as shown here:
image

Enable Bluetooth in the operating system settings and observe that scan results are apparent in the system dialog.

Set a breakpoint in Chrome Dev Tools in the callback function for:

BleClient.requestLEScan(
   {services: []}, 
   (result) =>  {
      console.log(result); // set breakpoint here
   }
)` 

... and observe that it never executes, despite the same code working fine on iOS and Android builds.

The following prompt appears in Chrome:
image

... but clicking "Allow" doesn't make a difference, and Chrome doesn't seem to "remember" that I clicked allow either - it asks every time.

Expected behavior
Invoking a Bluetooth scan should cause the callback to fire in Web Bluetooth same as on iOS and Android. Allow dialog should not come up every time a scan is invoked?

Screenshots
N/A

Plugin version:

  • @capacitor-community/bluetooth-le: 3.1.4

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.5 LTS
  • Browser: Google Chrome
  • Version: 130.0.6723.69 (Official Build) (64-bit)

Additional context
NodeJS : v18.20.2
npm : 10.5.0
OS : Linux 6.9
Angular: 16.2.9
@ionic/[email protected]
@capacitor/cli: 5.7.5
@capacitor/core: 5.7.8

@vicatcu vicatcu added the bug Something isn't working label Oct 24, 2024
@pwespi
Copy link
Member

pwespi commented Oct 28, 2024

Note that requestLEScan of Web Bluetooth is still experimental and has bugs. On the implementation status page Linux is not even listed as supported. Therefore I don't think there is anything that can be done about this in the plugin.

You could try to use navigator.bluetooth.requestLEScan directly and I suspect you would get the same results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants