flutternetwork / WiFiFlutter

Flutter plugin suite for various WiFi services.
https://wifi.flutternetwork.dev
290 stars 182 forks source link

[wifi_scan] startScan() returning false on 4th call. #369

Closed Bojan227 closed 9 months ago

Bojan227 commented 9 months ago

Future scanWifiNetworks() async { final canScan = await wiFiScan.canStartScan();

if (canScan != CanStartScan.yes) {
  throw 'Unable to scan';
}

return await wiFiScan.startScan();

}

Calling this method on every 10 seconds will return false on the 4th try. Any idea why this is the case and why when I wait for 2-3 min then again works as normal?

daadu commented 9 months ago

There are various restrictions and throttling applied by Android - https://developer.android.com/develop/connectivity/wifi/wifi-scan#wifi-scan-throttling

Closing this issue. Feel free to ask for re-opening.