From 85daf090a93af01c8a737ffc15ed35890925630d Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 31 Mar 2024 23:49:48 +0530 Subject: [PATCH] Added mdns for iOS --- CHANGELOG.md | 3 ++ example/pubspec.lock | 92 ++++++++++++++++++++++++++-------- lib/src/configure_flutter.dart | 10 +++- pubspec.yaml | 2 +- 4 files changed, 83 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4937ae3..e7bb17d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## 2.0.2 +1. Mdns search works on iOS now. + ## 2.0.1 1. Bug fixes and improvements diff --git a/example/pubspec.lock b/example/pubspec.lock index f46d1a3..7a4b11e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: csv - sha256: "63ed2871dd6471193dffc52c0e6c76fb86269c00244d244297abbb355c84a86e" + sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "6.0.0" cupertino_icons: dependency: "direct main" description: @@ -109,10 +109,10 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" flutter: dependency: "direct main" description: flutter @@ -151,10 +151,10 @@ packages: dependency: transitive description: name: http - sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" http_parser: dependency: transitive description: @@ -167,10 +167,10 @@ packages: dependency: transitive description: name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.19.0" + version: "0.18.1" json_annotation: dependency: transitive description: @@ -263,17 +263,65 @@ packages: dependency: transitive description: name: network_tools - sha256: c7543a957006047d4b6e7442c2cc0f592a1dd6572a6c1024301bc11dc53d45de + sha256: cf5726a3c3edd82de5f6d6511cb618259a083225ccc2bdb8a55d87b37014cadf url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.0.2" network_tools_flutter: dependency: "direct main" description: path: ".." relative: true source: path - version: "2.0.0" + version: "2.0.2" + nsd: + dependency: transitive + description: + name: nsd + sha256: "88a3ba4e6dc38363f1256b4b482abdeec396d99df31a064d545e559cb4cb6ba9" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + nsd_android: + dependency: transitive + description: + name: nsd_android + sha256: "7a38d0b2d21f1e578cd3020940b95b22d5260413dc0c8cf30a987a4e410b166d" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + nsd_ios: + dependency: transitive + description: + name: nsd_ios + sha256: "7034134dd89595362d5e464030081b0d542120a558ab7fe6227df44365df3e8a" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + nsd_macos: + dependency: transitive + description: + name: nsd_macos + sha256: "2403b8d599f50fc9179db1420a0ffc25bfa8bbeb814aa31ca0a71f804fc938da" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + nsd_platform_interface: + dependency: transitive + description: + name: nsd_platform_interface + sha256: "2f4033fa13cc45375253bf348abdb9712004e656462205543ec9506b43c67bb2" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + nsd_windows: + dependency: transitive + description: + name: nsd_windows + sha256: "06601efdd3268cbce4b90f8e23ae1dab445c97c661fba417821ce118add722e7" + url: "https://pub.dev" + source: hosted + version: "2.0.1" path: dependency: transitive description: @@ -350,18 +398,18 @@ packages: dependency: transitive description: name: process_run - sha256: cad2c57a34f8313a4182e34e31e0b2f12972eef3d0930cdc7ab3240bb8cad380 + sha256: "8d9c6198b98fbbfb511edd42e7364e24d85c163e47398919871b952dc86a423e" url: "https://pub.dev" source: hosted - version: "0.14.1+3" + version: "0.14.2" provider: dependency: transitive description: name: provider - sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" + sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c url: "https://pub.dev" source: hosted - version: "6.1.1" + version: "6.1.2" pub_semver: dependency: transitive description: @@ -374,10 +422,10 @@ packages: dependency: transitive description: name: sembast - sha256: "9a9f0c7aca07043fef857b8b365f41592e48832b61462292699b57978e241c11" + sha256: dbe19600cff55d43f19405be79138c3fd2c08a87b0b152b18609b9427d113a64 url: "https://pub.dev" source: hosted - version: "3.6.0" + version: "3.7.1" sky_engine: dependency: transitive description: flutter @@ -483,18 +531,18 @@ packages: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.5.1" win32: dependency: transitive description: name: win32 - sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" + sha256: "0a989dc7ca2bb51eac91e8fd00851297cfffd641aa7538b165c62637ca0eaa4a" url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.4.0" xdg_directories: dependency: transitive description: @@ -512,5 +560,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0 <4.0.0" + dart: ">=3.3.0 <4.0.0" flutter: ">=3.10.0" diff --git a/lib/src/configure_flutter.dart b/lib/src/configure_flutter.dart index eeaae83..9005a62 100644 --- a/lib/src/configure_flutter.dart +++ b/lib/src/configure_flutter.dart @@ -1,3 +1,4 @@ +import 'package:dart_ping_ios/dart_ping_ios.dart'; import 'package:logging/logging.dart'; import 'package:network_tools/network_tools.dart' as packages_page; // ignore: implementation_imports @@ -8,7 +9,9 @@ import 'package:network_tools/src/services/impls/arp_service_sembast_impl.dart'; import 'package:network_tools/src/services/impls/mdns_scanner_service_impl.dart'; import 'package:network_tools_flutter/src/network_tools_flutter_util.dart'; import 'package:network_tools_flutter/src/services_impls/host_scanner_service_flutter_impl.dart'; +import 'package:network_tools_flutter/src/services_impls/mdns_scanner_service_flutter_impl.dart'; import 'package:network_tools_flutter/src/services_impls/port_scanner_service_flutter_impl.dart'; +import 'package:universal_io/io.dart'; Future configureNetworkToolsFlutter( String dbDirectory, { @@ -31,13 +34,18 @@ Future configureNetworkToolsFlutter( // Setting dart native classes implementations ARPServiceSembastImpl(); - MdnsScannerServiceImpl(); // Setting flutter classes implementation HostScannerServiceFlutterImpl(); PortScannerServiceFlutterImpl(); + MdnsScannerServiceFlutterImpl(); final arpService = await ARPService.instance.open(); await arpService.buildTable(); await packages_page.VendorTable.createVendorTableMap(); + + // Register dart ping for main isolate + if (Platform.isIOS) { + DartPingIOS.register(); + } } diff --git a/pubspec.yaml b/pubspec.yaml index a05db13..1611c1e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: network_tools_flutter description: Extended features of network_tools package for flutter framework supporting iOS and Android -version: 2.0.1 +version: 2.0.2 issue_tracker: https://github.com/osociety/network_tools_flutter/issues repository: https://github.com/osociety/network_tools_flutter