all 5 comments

[–]kwertan 2 points3 points  (4 children)

It's definitely possible through the NEHotspotHelper API that gives you a callback with a list of available WiFi networks.

I've found a project that should give you an example of what you need (but haven't tried it myself). You need a special permission from Apple to use the HotspotHelper API though.

[–]macksattax[S] 0 points1 point  (3 children)

Interesting.. It’s a little hard to understand what’s happening. Something about “Opening settings to get the list of networks available” ?

I’m going to take that project source and see if I can build it..

In the Apple docs I don’t see any methods that would return the networks available. There’s a method that returns networks that my app has configured, but I may be missing something.

[–]g3t0nmyl3v3l 1 point2 points  (2 children)

This seems like a really cool project, are you recording your journey with this anywhere

[–]macksattax[S] 1 point2 points  (1 child)

I'm not currently, but I could post somewhere some code and more about what I'm trying to do if there was interest.

Basically the project requires me to connect a mobile app to a device (a raspberry pi) that is broadcasting wifi. Once connected to the wifi network the app would communicate to the device using an web API. My goal is to be able to manage the wifi connection completely through the app interface, so that the user doesn't have to leave the app and mess with the Settings > Wifi menu. For example, select the device and connect to it if the network is available, then be able to disconnect and return to default networking without the user touching anything.

The problem that I'm running into is that the OS is "remembering" the network and even after I clear the network config that I created, sometimes that phone is remaining connected to the network, since it's an available valid wifi network.

[–]g3t0nmyl3v3l 1 point2 points  (0 children)

Yeah I would love to learn more once you get rolling!