Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a list of Wifi-Networks in an iPhone app?

Tags:

cocoa

iphone

I found some private (undocumented) APIs but Apple does not allow apps to use private frameworks. So does anyone know how to do this using Apple official packages?

like: when youtube app prompts you to the push notification: "Select a Wi-fi network"

Thanks in advance.

like image 617
RoundOutTooSoon Avatar asked Jul 29 '09 21:07

RoundOutTooSoon


People also ask

How can I get a list of available Wi-Fi networks from iOS app?

To do this, open System Preferences, and then click Network. Select Wi-Fi in the sidebar, and then click Advanced. In the Wi-Fi tab, you will see a list of networks. This list is mainly there so you can choose an order of preference for joining networks.

How do I view all Wi-Fi networks on my iPhone?

From the Wi-Fi settings, tap the new "Edit" button and authenticate yourself using Face ID, Touch ID, or your passcode. Once authenticated, you'll see a list of Known Networks, which are all of the hotspots you've saved to your iPhone or iCloud Keychain from your other Apple devices.

How do I see a list of wireless networks?

Go to Start, and select Settings > Network & internet > Wi-Fi > Show available networks, and see whether your wireless network name appears in the list of available networks.

Does iPhone have a WiFi Analyzer app?

NetSpot — is the best WiFi analyzer app on the Apple App Store. Network Analyzer by Technet — can help you diagnose problems with your WiFi network and gather diagnostic information for a variety of different purposes. Wi-Fi SweetSpots — is more than just an internet speed test utility.


3 Answers

If you set the UIRequiresPersistentWiFi setting in your info.plist file, the iPhone OS will know that your app needs Wifi and pop up the message for you.

As far as I know, no app actually manually displays the wifi selection alert.

like image 70
Nathaniel Martin Avatar answered Oct 04 '22 04:10

Nathaniel Martin


Thats wrong check this app out

http://itunes.apple.com/us/app/ihome-connect-setup-app-for/id450241802?mt=8

It shows available wifi networks

like image 23
Zaid Choudhary Avatar answered Oct 04 '22 05:10

Zaid Choudhary


The best you can do in iOS, currently, is display the network the user is currently connected to. iOS doesn't allow you to access a wifi scan from within an app. I've been wrestling with this inability for some time now.

If designing an accessory that has WiFi, where you're trying to pass the user's WiFi network SSID and password, it will be up to the accessory to give the app that wifi scan list. The app can then display the list the accessory gave it to the user.

(I bet that's how the app @zaid pointed out in his answer, "iHome Connect", is doing it.)

Another approach is you could have a screen that prompts the user to enter the password to the wifi network they're connected to already, and then once the accessory is connected to the app, pass those details without the need for a wifi network list. I think that approach has a better user experience.

Plenty of stackoverflow questions that answer how to get the current wifi network, here's a couple:

Getting OSX Connected Wi-Fi Network Name

How do I get the current wifi network name after Yosemite in Swift?

like image 23
Barbituate Avatar answered Oct 04 '22 04:10

Barbituate