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

Check repeatedly for matching SSID on iOS #301

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

elliottkember
Copy link
Contributor

@elliottkember elliottkember commented Feb 25, 2023

I've found locally that sometimes the completionHandler for [NEHotspotConfigurationManager sharedManager] applyConfiguration returns before the network is fully connected.

There is an Apple Support thread about this here: https://developer.apple.com/forums/thread/111379 -

NEHotspotConfigurationManager calls its completion handler as soon as it has dealt with the request, that is, as soon as it has checked the request and passed it on to that Wi-Fi infrastructure. This has a significant impact on users of NEHotspotConfigurationManager: You can’t be guaranteed that the device has actually joined the Wi-Fi network by the time your completion handler is called. In fact this won’t be the case most of the time.
If there’s an error joining the Wi-Fi network, that error is reported to the user, not via your completion handler.

This patch checks the connected SSID every 0.5 seconds for 10 seconds, to see whether it's connected. I've been testing this locally and it seems to work great, so thought I should submit it for review in case this is helpful or I'm doing something wrong.

@elliottkember
Copy link
Contributor Author

Bumping this pull request, because we've been using it locally with great results ever since. This is a useful addition for connecting to small devices like 360 cameras (that's our use case).

@JuanSeBestia
Copy link
Owner

At the moment I can't test it, if some other mantainers like @eliaslecomte or @gitisaac want to test, approve and merge it, go ahead

@alexma01
Copy link
Contributor

alexma01 commented Feb 4, 2024

Hi guys,

can we merge this PR?

Thanks

@JuanSeBestia
Copy link
Owner

@alexma01 are you already test it?

@JuanSeBestia JuanSeBestia merged commit e7088be into JuanSeBestia:master Feb 12, 2024
JuanSeBestia pushed a commit that referenced this pull request Feb 12, 2024
# [4.11.0](v4.10.1...v4.11.0) (2024-02-12)

### Features

* **iOS, Loop patch:** check the connected WiFi network repeatedly until it's the one we requested ([#301](#301)) ([e7088be](e7088be))
@JuanSeBestia
Copy link
Owner

🎉 This PR is included in version 4.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bitcrumb
Copy link
Contributor

@JuanSeBestia @elliottkember Thank you for this! This has been on my to do list for way too long. Much appreciated!

@elliottkember
Copy link
Contributor Author

@bitcrumb A pleasure. Very happy to see this merged. It was nice to delete the patch we've been using. We haven't had any problems since this patch, so hoping others see the same great results.

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

Successfully merging this pull request may close these issues.

None yet

4 participants