0

I want get all available wifi network iphone . I use this code

import SystemConfiguration
import SystemConfiguration.CaptiveNetwork
func fetchSSIDInfo() -> String {
var currentSSID = ""
if let interfaces = CNCopySupportedInterfaces() {
for i in 0..<CFArrayGetCount(interfaces) {
let interfaceName: UnsafeRawPointer = CFArrayGetValueAtIndex(interfaces,i)
let rec = unsafeBitCast(interfaceName, to: AnyObject.self)
 print("teseeeeeeeee :\(rec)")           
let unsafeInterfaceData = CNCopyCurrentNetworkInfo("\(rec)" as CFString)
  if let interfaceData = unsafeInterfaceData as? [String: AnyObject] { currentSSID = interfaceData["SSID"] as! String
 let BSSID = interfaceData["BSSID"] as! String
let SSIDDATA = interfaceData["SSIDDATA"]
 debugPrint("ssid=\(currentSSID), BSSID=\(BSSID), SSIDDATA=\(SSIDDATA)")}}} return currentSSID}

this show in currentssid i want get all wifi ssid

1 Answers1

0

You cannot, if you use NEHotspotHelper, it was not designed as a general-purpose Wi-Fi scanning API and any attempt to use it as such will run into both business and technical problems. read this article also refer this

NavinBagul
  • 741
  • 7
  • 24