Connect to WiFi Access Point inside iOS App

We're looking to add functionality to an existing iOS App that would allow an acknowledgement inside the App to connect to a network, provided it is present and broadcasting nearby. Currently, we are redirecting to the Settings menu and making users to connect to it themselves.

This network is similar, but not identical, across all the devices which are already manufactured so a Wireless Accessory type configuration is not possible. The network has no password and is only needed temporarily to share the WiFi network credentials to the device.

Can this be done using https://developer.apple.com/documentation/networkextension/wi-fi_configuration and a Persistent connection?

It mentions: "This API can help with a wide variety of tasks. For example, you can use it to help a user join a specific Wi-Fi network, like the hotspot at a local coffee shop, or to set up an accessory that uses Wi-Fi." Looking through the forum though, I'm seeing other posts that say something like this is not possible through  NEHotspotConfigurationManager. Thanks in advance for any help or advice!

Yes, you can associate with a Wi-Fi network with or without a password from an app using the API for NEHotspotConfigurationManager. A sample of this process can be found here or here (for a more advanced setup). A key thing to remember here is that your app will need to at least know the SSID that your app is associating to before it uses those APIs. An iOS app cannot scan for nearby SSIDs, as mentioned here.

Thanks for your response! Right now, the SSID is "[Name that is always the same]_[Unique Serial Number]." I think this won't be possible because you have to provide the exact SSID, but it will vary between WiFi modules because of unique serial numbers. Does that sound right to you @meaton? Or is there a way to use wildcards or something like that?

NEHotspotConfiguration also contains a designated initializer that takes an SSID prefix, which would work in your situation. Please see the docs here.

Excellent, that sounds like exactly what I need. Thanks DTS Engineer!

Connect to WiFi Access Point inside iOS App
 
 
Q