1

I am working on application where i need to get mobiles wifi Router's manufacturer name(EX:: Kasda Network Inc or Huawei technologies co. ltd ).Here an app which shows Vendor name like Below. How can i get exact information about vendor like below enter image description here

Mehsam Saeed
  • 235
  • 2
  • 14
  • Possible duplicate of [How to get a unique device ID in Swift?](https://stackoverflow.com/questions/25925481/how-to-get-a-unique-device-id-in-swift) – El Tomato Nov 06 '18 at 08:46
  • @ElTomato thanks .actually i am searching for [https://stackoverflow.com/questions/2189200/get-router-mac-without-system-call-for-arp-in-objective-c] but i think this is for mac os butt i needed for iOS – Mehsam Saeed Nov 06 '18 at 09:27

2 Answers2

0

try with this

import SystemConfiguration.CaptiveNetwork
func getSSID() -> String? {

        let interfaces = CNCopySupportedInterfaces()
        if interfaces == nil {
            return nil
        }

        let interfacesArray = interfaces as! [String]
        if interfacesArray.count <= 0 {
            return nil
        }

        let interfaceName = interfacesArray[0] as String
        let unsafeInterfaceData =     CNCopyCurrentNetworkInfo(interfaceName as CFString)
        if unsafeInterfaceData == nil {
            return nil
        }

        let interfaceData = unsafeInterfaceData as! Dictionary <String,AnyObject>

        return interfaceData["SSID"] as? String
    }
Pushp
  • 1,064
  • 10
  • 18
0

Question contains two parts.

1:How to get Mac Address of connected wifi

2:On base of that Mac address get manufacturer name

1:getting Mac address

func getConnectedWifiMacAdrees()-> [String:String]{
        var informationDictionary = [String:String]()
        let informationArray:NSArray? = CNCopySupportedInterfaces()
        if let information = informationArray {
            let dict:NSDictionary? = CNCopyCurrentNetworkInfo(information[0] as! CFString)
            if let temp = dict {
                informationDictionary["BSSID"] = String(temp["BSSID"]as!String)
                return informationDictionary
            }
        }

        return informationDictionary
    }

NOTE::import SystemConfiguration.CaptiveNetwork

2:get to know about which mac address belongs from which manufacturer .Download latest manufacturer data from IEEE portal here or here

Mehsam Saeed
  • 235
  • 2
  • 14