Browse Source

上传扫描修复

weicu
liwei1dao 5 months ago
parent
commit
4270bec876
  1. 6
      lib/modules/devices/controllers/devices_controller.dart

6
lib/modules/devices/controllers/devices_controller.dart

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:device_jieli/device_jieli.dart';
import 'package:flutter/material.dart';
@ -310,6 +311,11 @@ class DevicesController extends GetxController {
}
Future<bool> _ensureBluetoothPermission() async {
// iOS: CoreBluetooth 首次扫描时由系统自动弹出蓝牙权限对话框
// (依赖 Info.plist 的 NSBluetoothAlwaysUsageDescription),
// permission_handler 的 bluetoothScan/bluetoothConnect 是 Android 专属,
// 在 iOS 上调用永远返回 denied,会误拦截扫描。
if (Platform.isIOS) return true;
try {
final results = await [
Permission.bluetoothScan,

Loading…
Cancel
Save