In systems like Alexa or Sonos, the mobile app asks for location access and from there it tries to find the device.
After that one is prompted to enter the wifi details and attach the device with the local network.
What is actually going on behind the scenes?
How does the app discover a hardware device without it first being in the network itself?
What I was doing till now was advertising a Wifi AP, which needs to be connected from the app, enter the details and reconnect back to my local network. The Pi then attempts to connect itself with my home wifi.
But how does this whole location access thing work? I would like to know the theory.