Is there any way to detect if the wifi connection is secured using swift? is it possible to get the type security on the wifi? wpa, wep etc.
I get the ssid name in this way:
func getWiFiSsid() -> String? {
var ssid: String?
if let interfaces = CNCopySupportedInterfaces() as NSArray?
for interface in interfaces {
if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? {
ssid = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String
break
}
}
}
return ssid
}
Thanks.
Not possible to get WiFi(current connected) security in CNCopySupportedInterfaces
Go to see the detail:
https://forums.developer.apple.com/message/342349#342349
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With