diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 16e1ddb6ba9..c11c01d660a 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1964,14 +1964,16 @@ List? urlLinkToCmdArgs(Uri uri) { command = '--connect'; id = uri.path.substring("/new/".length); } else if (uri.authority == "config") { - final config = uri.path.substring("/".length); - // add a timer to make showToast work - Timer(Duration(seconds: 1), () { - importConfig(null, null, config); - }); + if (Platform.isAndroid || Platform.isIOS) { + final config = uri.path.substring("/".length); + // add a timer to make showToast work + Timer(Duration(seconds: 1), () { + importConfig(null, null, config); + }); + } return null; } else if (uri.authority == "password") { - if (Platform.isAndroid) { + if (Platform.isAndroid || Platform.isIOS) { final password = uri.path.substring("/".length); if (password.isNotEmpty) { Timer(Duration(seconds: 1), () async { diff --git a/flutter/lib/mobile/pages/scan_page.dart b/flutter/lib/mobile/pages/scan_page.dart index 32ac3ed0910..6eb4862a036 100644 --- a/flutter/lib/mobile/pages/scan_page.dart +++ b/flutter/lib/mobile/pages/scan_page.dart @@ -8,6 +8,7 @@ import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:zxing2/qrcode.dart'; import '../../common.dart'; +import '../../consts.dart'; import '../widgets/dialog.dart'; class ScanPage extends StatefulWidget { @@ -60,7 +61,11 @@ class _ScanPageState extends State { var reader = QRCodeReader(); try { var result = reader.decode(bitmap); - showServerSettingFromQr(result.text); + if (result.text.startsWith(kUniLinksPrefix)) { + handleUriLink(uriString: result.text); + } else { + showServerSettingFromQr(result.text); + } } catch (e) { showToast('No QR code found'); }