For the users of my app/product.
at home I would expect that "the user device with your app" - my smartphone - is logged into my home wifi.
So the ESP8266 has also to be connected to the home wifi.
To set up the home wifi on the ESP8266 you can use the wifi manager (als already told) or you write your own captive portal.
This will work like following: when you ship your product, the esp will span its own wifi.
The user has to log on the device ONCE to that wifi.
The user has to enter his WLAN SSID and the Password
Wenn the user restarts the ESP, it should connect to the users wifi.
now the user should connect his smartphone back to his home wifi.
and the app should be able to find the esp.
If you want to go the path with Wifi provision ... do whats proposed in the "Video" ... wherever it's explained in detail ... (TLDR).
that's what I meant with
when you start your custom device, it goes into access points mode, publishes an SSID recognisable name and awaits for a client to connect (typically your iPhone selecting that SSID)
Once the WiFi network is selected, it uses what's called a Captive Portal. A Captive Portal is a web page / splash screen that you encounter when connecting to a public Wi-Fi network or other restricted network access which requires users to authenticate or agree to terms and conditions before being granted full access to the network. This is commonly used in places like airports, hotels, coffee shops, ... to control and manage guest access to the internet.
Here instead of presenting a screen showing the terms and conditions and an I agree button, you can present an interface either the canned one (or you can have a custom one)
for example you would see
and then you select Configure WiFi and it will show you the available WiFi networks you can choose from and then you just type the password and you are all set, the ESP will connect to the WiFi network using those credentials.
you can also present other fields if you need to ask for extra information / preferences to configure the device.
The UI is pretty simple yet effective and you can make it better by coding it yourself.
this way there is no app to be downloaded by the end user.
the other typical way this is done is through BLE.
if you are in the HomeKit world, you could use HomeSpan and your device would become discoverable/configureable right the in the Home app.
Or you can just leverage BLE advertising and have a custom app which detects the device and offers a configuration screen.
if your product does just need this one time configuration thingy and does not need a companion app then I would recommend going with the HomeKit or the Captive portal approach. This way there is nothing to install on the end user smartphone.
I have tried the wifi manager, and was successful in getting the work done.
but the problem I am facing is I need the user to be able to do this in my app because I have to send some authentication tokens through http to configure device to be a specific one, so it can be controlled automatically according to the schedule. And I will have multiple ESP8266s so controlling each esp8266 automatically is part of the functionality I am trying to achieve.
OK
I doubt you'll be able to see all the WiFi SSIDs or join them in at least in iOS - BLE might be a better avenue.

