Can we get list of WiFi networks available nearby?

Greetings Everyone,


I want to connect my IOT device to WiFi network from my app. For that I need to fetch the WiFi connections available nearby to the iOS device and list them in my app. From that list the user will select the network and then the device gets connected to the selected network.


I've extensively searched on different portals for the same and couldn't produce some concrete reference for fetching the network list. I came across some tutorial videos on YouTube demonstrating setting up the Google Home Mini device and Amazon Echo Dot 3 device to the WiFi network. Both devices are configured with the help of their individual apps i.e Google Home App and Alexa App. In both these apps the user is presented with a list of nearby available WiFi networks. I am also providing below the links of screenshots from the tutorials videos of the network list from both those apps.


Alexa App Screenshot:- https://ibb.co/f9zf2qn

Google Home App Screenshot:- https://ibb.co/B4WxvKd


Regards

Vaanhc

Replies

First up, please read QA1942 iOS Wi-Fi Management APIs.

As stated in the Q&A, iOS does not have a general-purpose API for scanning for nearby Wi-Fi networks. If you’re building a Wi-Fi accessory and you want to get it on to the user’s Wi-Fi network, your best option is to support Wireless Accessory Configuration (WAC). This results is a great user experience, where the user just selects their accessory (in Settings or in your app) and then authorises the system to share your Wi-Fi settings with it.

The main downside with WAC is that the hardware must be built under the aegis of the MFi developer programme.

If you don’t support WAC then there are a variety of less-than-ideal options. There’s two sticking points:

  • Getting the iOS device to join the accessory’s temporary network (A).

  • Getting the Wi-Fi settings to pass to the accessory (B)

With regards A, you can use

NEHotspotConfigurationManager
to make the switch, but you need to give it the Wi-Fi settings to join, including the SSID. As you can’t scan for the SSID on iOS, you’ll have to find it some other way. For example:
  • If your accessory supports Bluetooth LE, you can have it publish it that way.

  • If your accessory has that info on a barcode, you can scan that barcode.

  • If all else fails, you can have the user enter it by hand.

With regards B, read this post for a summmary.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"