Get Current Wifi Connection
Apr 21, 2017
From <2017-04-21 Fri> it is possible to get the current wifi information from the Captive Network. In the past, apple actually disabled this api for a while, but they seems to re-enabled it due to strong request. It is also possible that they decide to close this api in the future.
Captive Network
The information we can get is BSSID, SSID, SSIDDATA. BSSID is the unique address for wifi, SSID is the current wifi name, SSIDDATA is the hex representation for the SSID.
Swift
Updated at <2017-04-21 Fri> for Swift 3.1, XCode 8.3
1 | func printCurrentWifiInfo() { |
Objective-C
Updated at <2017-04-21 Fri> for clang-802.0.38, XCode 8.3
1 | NSArray *interFaceNames = (__bridge_transfer id)CNCopySupportedInterfaces(); |
