-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While calling scnaNetworks() app crashed. #7
Comments
Google has now documented the limitations for startScan() function in Android P: "We are further limiting the number of scans apps can request to improve network performance and improve battery life. The WifiManager.startScan() usage is limited to: - Each foreground app is restricted to 4 scans every 2 minutes. - All background apps combined are restricted to one scan every 30 minutes." Source: https://issuetracker.google.com/issues/79906367 Edit 8-Aug-2018: Information has been added also here: https://developer.android.com/guide/topics/connectivity/wifi-scan |
Hey! I too am facing this error, and probably its due to this throttle limitation only. So can I get some help for knowing how exactly can I use this scanNetworks() method encountering this error? Is it totally impossible for us to call the scanNetworks() function, even after (lets say) a gap of 45 seconds or a minute? I tried giving this much of delay between two scanNetworks() calls, but the error persists... |
You need to ensure that you have the correct permissions to make a scan wifi request and you need to make the requests in code before scan wifi is called: I don't suggest wrapping the error in a try catch as in reality you should require the user grant the necessary permissions before trying to scan networks. |
Depending on your use case though https://github.com/weplenish/flutter_wifi_connect may be a better fit. |
While calling ScanNetworks() method Application get crashed and receive below error.
The text was updated successfully, but these errors were encountered: