connectBluetooth method

  1. @override
Future<bool> connectBluetooth({
  1. required String macAddress,
})
override

identifier trên iOS là UUID string của CBPeripheral. Trên Android là MAC address. Giữ tên param là macAddress để tương thích backward.

Implementation

@override
Future<bool> connectBluetooth({required String macAddress}) async {
  return await _channel.invokeMethod(PrinterMethod.connectBt.value, {
    // iOS: macAddress là UUID identifier từ CBPeripheral
    // Android: macAddress là MAC address thực
    "mac_address": macAddress,
  });
}