iOS如何以最少的用户交互连接特定的WiFi SSID

时间:2013-04-17 02:59:48

标签: ios objective-c networking wifi ssid

我必须使用iphone应用程序,他们使用两个不同的网络。更改每个应用程序的网络设置不是用户友好的。我想做以下这样的事情,

当应用程序启动时,它会检查特定网络(SSID)的可用性,并向用户弹出一条允许连接的消息。一旦用户点击“确定”,他们就会连接到该特定网络。

有人有类似的经历吗? 如何使用objectiveC连接到给定的SSID?

1 个答案:

答案 0 :(得分:0)

我一直在寻找实现app控制网络的解决方案,但如果不使用Apple80211私有API似乎是不可能的。

我认为你能做的最好的事情是CaptiveNetwork

使用此功能,您可以为您的设备注册一份SSID列表,它将禁止显示网页。

来自doc:

By calling the CNSetSupportedSSIDs function, an application can register a list of wireless network SSIDs with Captive Network Support, thereby assuming responsibility for authenticating with those networks. Typically when a user joins a captive network, Captive Network Support provides a web sheet that allows the user to authenticate with the network. If an application has registered the SSID of the captive network, however, the web sheet is suppressed, and the user can complete authentication in the appropriate application.