iOS获取当前的wlan网络名称 [英] iOS get current wlan network name
问题描述
我正在寻找一种方法来获取iOS5目标-c中当前连接的wlan网络的信息(至少名称)。
I am looking for a way to obtain information (at least the name) of the current connected wlan network in objective-c for iOS5.
我需要这个,因为我们目前正在开发一种在特定网络中无法运行的应用程序。在这个网络(在我们大学),我们需要连接到服务器的端口关闭。但是还有另一个网络可用,我们想告诉用户如果他连接到上述网络,他必须切换网络。
I need this because we are currently developing an application that do not work in a particular network. In this network (on our university) the port is closed that we need to connect to the server. But there is another network also available and we want to tell the user that he has to switch the network if he is connected to the aforementioned one.
我甚至都不知道从哪儿开始。有没有人有想法或任何提示?
I do not even know where to start. Does anyone have an idea or any hints?
谢谢和问候
推荐答案
从iOS> = 4.1,可以获得设备当前连接的无线网络的SSID。
From iOS >= 4.1 it's possible to obtain SSID of wireless network that device is currenctly connected to.
为此您将使用函数 CNCopyCurrentNetworkInfo
有关实施的详细信息,请访问SO: iPhone获取SSID私人图书馆
Details on implemenation are available on SO: iPhone get SSID without private library
这篇关于iOS获取当前的wlan网络名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!