You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've looked at the README 'Common Problems' section
Have you checked this problem on the example app?
No
FlutterBluePlus Version
1.34.5
Flutter Version
3.27.0
What OS?
macOS
OS Version
MacOS 15.2
Bluetooth Module
custom
What is your problem?
With FBP web, when I try to get services for a device, it fails with this:
DartError: FlutterBluePlusException | discoverServices | web-code: 0 | SecurityError: Origin is not allowed to access any service. Tip: Add the service UUID to 'optionalServices' in requestDevice() options. https://goo.gl/HxfxSQ
I am running with flutter run -d chrome
I have tried to specify optionalServices in flutter_blue_plus_web.dart but either I don't have the syntax right or it isn't the right solution. Can you help?
options = RequestDeviceOptions(
filters: filters.toJS,
optionalServices:
js.JsArray.from([Guid.fromString('00006459-0000-1000-8000-00805F9B34FB'), Guid.fromString('6459')])
as JSArray);
@mgeilich first of all you need to use flutter_blue_plup: ^1.35.0 in your pubspec.yaml.
The flutter_blue_plus_web is an endorsed package and it will be automatically included.
The error you seeing "Origin is not allowed to access any service. Tip: Add the service UUID to 'optionalServices' in requestDevice() options" is somewhat misleading in the context of Flutter/Dart. It is the web bluetooth error, which is basically telling you that you have to specify service UUIDs you want to connect to when doing the device scan.
So, you have to use the FlutterBluePlus.startScan(..., withServices: services) and specify your services there.
Requirements
Have you checked this problem on the example app?
No
FlutterBluePlus Version
1.34.5
Flutter Version
3.27.0
What OS?
macOS
OS Version
MacOS 15.2
Bluetooth Module
custom
What is your problem?
With FBP web, when I try to get services for a device, it fails with this:
DartError: FlutterBluePlusException | discoverServices | web-code: 0 | SecurityError: Origin is not allowed to access any service. Tip: Add the service UUID to 'optionalServices' in requestDevice() options. https://goo.gl/HxfxSQ
I am running with flutter run -d chrome
I have tried to specify optionalServices in flutter_blue_plus_web.dart but either I don't have the syntax right or it isn't the right solution. Can you help?
options = RequestDeviceOptions(
filters: filters.toJS,
optionalServices:
js.JsArray.from([Guid.fromString('00006459-0000-1000-8000-00805F9B34FB'), Guid.fromString('6459')])
as JSArray);
Logs
The text was updated successfully, but these errors were encountered: