Skyost / Bonsoir

A Zeroconf library that allows you to discover network services and to broadcast your own. Based on Apple Bonjour and Android NSD.
http://bonsoir.skyost.eu/
Other
100 stars 43 forks source link

Google Pixel 7 Pro with 2.0.0 cannot found devices. #60

Closed julianLight closed 8 months ago

julianLight commented 8 months ago

Describe the bug Pixel 7 Pro never found bonjour service.

Smartphone (please complete the following information):

Additional context There is sample code in my app.

BonsoirDiscovery _discovery = BonsoirDiscovery(type: "_dp_Example._tcp."); await _discovery.ready; await _discovery.start(); _discovery.eventStream?.listen((BonsoirDiscoveryEvent event) async { debugPrint('bonjour. type: ${event.type}, service: ${event.service}, isResolved: ${event.isServiceResolved}.'); if (event.type == BonsoirDiscoveryEventType.discoveryServiceResolved) { final service = event.service; _action(service); } }, onError: (e) { debugPrint(e.toString()); });

The debugPrint only print: bonjour. type: BonsoirDiscoveryEventType.discoveryStarted, service: null, isResolved: false. Even other devices can correctly catch right services.

Skyost commented 8 months ago

Ran some tests today on my Google Pixel 7 on the master branch and found no problem so far. Could you please try it ?

In your pubspec.yaml :

dependency_overrides:
  bonsoir:
    git:
      url: https://github.com/Skyost/Bonsoir.git
      ref: master
      path: bonsoir
  bonsoir_android:
    git:
      url: https://github.com/Skyost/Bonsoir.git
      ref: master
      path: bonsoir_android
  bonsoir_darwin:
    git:
      url: https://github.com/Skyost/Bonsoir.git
      ref: master
      path: bonsoir_darwin
  bonsoir_platform_interface:
    git:
      url: https://github.com/Skyost/Bonsoir.git
      ref: master
      path: bonsoir_platform_interface
Skyost commented 8 months ago

Marked as completed for now. Try with 4.0.0 and tell me if it works for you.

julianLight commented 7 months ago

I finally found the problem that I use domain name with a capital character. I surprised it work on most phone but some just cannot. However after I changed them to lower case, it works on all devices. Thank you for reply.