VNAPNIC / flutter_nearby_connections

Flutter plugin support peer-to-peer connectivity and the discovery of nearby devices for Android vs IOS
https://pub.dev/packages/flutter_nearby_connections
BSD 2-Clause "Simplified" License
106 stars 68 forks source link

Is there a way to know if the device is currently in advertising mode or browsing mode? #31

Open sasikdar opened 2 years ago

sasikdar commented 2 years ago

Hi, I am trying to advertise and browse at the same time(https://github.com/VNAPNIC/flutter_nearby_connections/issues/21), what happens however is that both devices are stuck in browsing mode and stay a long time in browsing mode. Is there a way to check the current mode and change the mode?

bioweed commented 2 years ago

Hi, you can check the modes via the log. It should say that advertising or browsing has started. To fix your issue of them not discovering and advertising simultaneously, simply delete the "await" before nearbyService.startAdvertisingPeer(); nearbyService.startBrowsingForPeers(); in these lines.