Refactor BLE plugin structure and rename to 'ble' for consistency across platforms

This commit is contained in:
TonyLu
2026-05-07 17:22:39 +08:00
parent d670143817
commit 020abb118f
19 changed files with 163 additions and 121 deletions
+23
View File
@@ -0,0 +1,23 @@
import Foundation
import Flutter
/// iOS stub - BLE peripheral (CoreBluetooth CBPeripheralManager) is available on iOS but
/// not yet implemented. `isSupported` returns false; all other methods are no-ops.
public class BlePlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(
name: "com.dalimaster.ble",
binaryMessenger: registrar.messenger())
let instance = BlePlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
switch call.method {
case "isSupported":
result(false)
default:
result(nil)
}
}
}