Skip to content
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

[Question]: Issue in Flutter Application with Wi-Fi Connectivity on iOS #3360

Open
8 tasks done
srisudhanl opened this issue Nov 19, 2024 · 4 comments
Open
8 tasks done
Labels
question Further information is requested

Comments

@srisudhanl
Copy link

What is your question?

I am developing a Flutter application that:

  • Checks for Wi-Fi connectivity and displays the details to the user in a dialog.

Behavior Observed:

  • On Android, the application works perfectly, even when connected to a Wi-Fi network without internet access.
  • On iOS, the application behaves unexpectedly:
    • When connected to a Wi-Fi network with internet access, it works as expected.
    • When connected to a Wi-Fi network without internet access, the results are incorrect. (always showing as none. But Wi-Fi is connected to the mobile).

Details:
I am using the following packages for checking Wi-Fi connectivity:

  1. connectivity_plus
  2. network_info

Both packages lead to unexpected results when testing on iOS.


Question:
How can I resolve this issue or achieve reliable Wi-Fi connectivity detection, especially for Wi-Fi networks without internet access, on iOS?

Checklist before submitting a question

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I am using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@srisudhanl srisudhanl added the question Further information is requested label Nov 19, 2024
@miquelbeltran
Copy link
Member

When connected to a Wi-Fi network without internet access, the results are incorrect. (always showing as none. But Wi-Fi is connected to the mobile).

I assume this is Connectivity Plus saying that connectivity is none even when the WiFi connectivity appears on the device status bar, right?

It could be that the device disconnects from wifi and forces to use the phone network if it detects no internet connectivity.

iOS (and macOS) use NWPathMonitor to obtain the connectivity status, so that's something you can research and see why NWPathMonitor does not report wifi if there is no internet connection.

The code:

@fullflash
Copy link

same happenes on simulator after second wifi turn off and turn on , onConnectivityChanged is not fired and checkConnectivity method gives none response.

@Keerthisindhigeri1

This comment was marked as off-topic.

@miquelbeltran
Copy link
Member

same happenes on simulator after second wifi turn off and turn on , onConnectivityChanged is not fired and checkConnectivity method gives none response.

in the README you can find the following information:

On iOS simulators, the connectivity types stream might not update when Wi-Fi status changes. This is a known issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants