是否可以在不使用私有库的情况下获取iPhone上所有可用SSID 的列表?
我在没有私有库的情况下阅读iPhone获取SSID,这是关于获取有关当前网络的详细信息.
这个答案提到:
如果您越狱设备,您可以使用Apple80211私有框架查找可用的Wi-Fi网络及其信号强度.但这也意味着您的应用会被拒绝.
Apple拥有CaptiveNetwork API,但似乎没有一个解决方案来获取所有可用网络的列表.似乎只能通过使用Apple80211私有库或连接到所有这些库来实现.
我错过了什么,或者没有解决方案?
我正在使用 NEHotspotHelper 并尝试注册但未收到回电。首先,
然后添加了以下代码,
let options: [String: NSObject] = [kNEHotspotHelperOptionDisplayName : "ABC" as NSObject]
let queue: DispatchQueue = DispatchQueue(label: "com.ABC", attributes: DispatchQueue.Attributes.concurrent)
NSLog("Started wifi scanning.")
NEHotspotHelper.register(options: options, queue: queue) { (cmd: NEHotspotHelperCommand) in
NSLog("Received command: \(cmd.commandType.rawValue)")
if cmd.commandType == NEHotspotHelperCommandType.filterScanList {
//Get all available hotspots
let list: [NEHotspotNetwork] = cmd.networkList!
//Figure out the hotspot you wish to connect to
print(list)
} else if cmd.commandType == NEHotspotHelperCommandType.evaluate {
if let network = cmd.network {
//Set high confidence for the network …Run Code Online (Sandbox Code Playgroud)