The IoT device should connect to the home WiFi rather than the device running the configurator app. This solves the following bugs:
Device out of range issue — when the configurator device is within proximity or the WiFi but not the configuring device.
Lack of support for Wifi connection by various mobile platforms:
In Android when the WiFi has already been connected natively by the user, an app cannot connect and verify the same Wifi as even entering a wrong password would make the app connect successfully (using the pre-entered password) and show as success with the wrong password. The app cannot access this user-entered password either as it shows up as a security issue. The alternative approach was to remove the Wifi connection made by native user programmatically but even that has been removed since Android 6.0In iOS only libraries exist for jailbroken devices to allow directly connecting to the Wifi. The alternative is by pushing a "Connection Profile” but apps that do this are not get accepted by the App Store as they raise security concerns.
Optimal solution
The configurator should connect to the IoT device’s network first. Have the IoT device get the list of available networks in range and send it to the configurator to show it to the user. The user enters the password and the configurator verifies if it can connect and returns a success signal to proceed to the next step.
The IoT device should connect to the home WiFi rather than the device running the configurator app. This solves the following bugs:
Optimal solution
The configurator should connect to the IoT device’s network first. Have the IoT device get the list of available networks in range and send it to the configurator to show it to the user. The user enters the password and the configurator verifies if it can connect and returns a success signal to proceed to the next step.
Sources
iOS lack of Wifi connection support — http://stackoverflow.com/a/35614107/997147 and http://stackoverflow.com/a/40901283/997147