My phone is connected to wifi.I want to get mac address of my wifi.
BSSID and mac address is same thing. You can get mac address from this function. just import SystemConfiguration.CaptiveNetwork
func getWIFIInformation() -> [String:String]{
var informationDictionary = [String:String]()
let informationArray:NSArray? = CNCopySupportedInterfaces()
if let information = informationArray {
let dict:NSDictionary? = CNCopyCurrentNetworkInfo(information[0] as! CFStringRef)
if let temp = dict {
informationDictionary["SSID"] = String(temp["SSID"]!)
informationDictionary["BSSID"] = String(temp["BSSID"]!)
return informationDictionary
}
}
return informationDictionary
}