更新ios蓝牙权限

This commit is contained in:
wyf
2025-08-21 16:35:14 +08:00
parent 5cb59bb5be
commit 841f143f97
7 changed files with 85 additions and 60 deletions

View File

@@ -62,7 +62,24 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
);
try {
web.jsbridge!.bind((bridge) {
var minible = Minibleapp(bridge: bridge);
var minible = Minibleapp(
bridge: bridge,
onConnect: (args1, args2) {
final devices = args1.devices as Map<String, dynamic>;
final mac = args2 as String;
// 找出对应设备
final device = devices[mac];
if (device != null) {
ef.log('Minibleapp connected: $mac -> $device');
return device;
} else {
ef.log('Minibleapp connected: $mac not found in devices');
return null;
}
},
);
// ef.kvroot.devicelist.listen((x) {});
bridge.sdk.updateDeviceRoute((args) async {
ef.log('updateDeviceRoute: $args');