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

前端 未结 3 1381
庸人自扰
庸人自扰 2021-02-10 06:17

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:

相关标签:
3条回答
  • 2021-02-10 06:39

    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

    0 讨论(0)
  • 2021-02-10 06:48

    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.

    0 讨论(0)
  • 2021-02-10 07:00

    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?

    0 讨论(0)
提交回复
热议问题