iOS API检测无线网络 [英] iOS API detect wireless networks

查看:163
本文介绍了iOS API检测无线网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CocoaTouch / iOS中是否有用于检测无线网络的API?我想写一个应用程序来保存手机在给定时刻可以看到的网络列表。

Is there an API in CocoaTouch/iOS for detecting wireless networks? I want to write an app that saves a list of networks the phone can see at a given moment.

推荐答案

知道您可以使用 CNCopySupportedInterfaces 和 CNCopyCurrentNetworkInfo ://developer.apple.com/library/ios/#documentation/SystemConfiguration/Reference/CaptiveNetworkRef/Reference/reference.htmlrel =nofollow> CaptiveNetwork 。您可以参考:我如何请使用CaptiveNetwork获取更多信息的当前WiFi热点名称。

As far as I know you can get the information about the current connected Wi-Fi using CNCopySupportedInterfaces and CNCopyCurrentNetworkInfo of CaptiveNetwork. You can refer to: How do I use CaptiveNetwork to get the current WiFi Hotspot Name for more information.

According to iPhone get a list of all SSIDs without private library:

Without the use of private library (Apple80211) you can only get the SSID of the network your device is currently connected to.

您可以查看 iphone-wireless 项目。有一个示例应用程序 Stumber ,它完全按照您的要求。但是如果您要发布到App Store,则无法在您的应用中使用此方法,因为它使用私有API

You could have a look at iphone-wireless project if you are interested in Apple80211. There exists a sample app "Stumber" which does exactly what you want. But you cannot use this in your app if you want to publish to App Store because as it uses private APIs

这篇关于iOS API检测无线网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆