CNCopySupportedInterfaces not working

Originator:garth
Number:rdar://21992255 Date Originated:24-Jul-2015 04:49 PM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 9 beta 4
Classification:Serious Bug Reproducible:Always
 
I’m using the boilerplate code below to determine the name of the currently-connected WiFi network. As of beta 4, CNCopySupportedInterfaces() always seems to return nil.

        if let ifs = CNCopySupportedInterfaces() {
            for ifnam in ifs as Array {
                if let info = CNCopyCurrentNetworkInfo(ifnam as! String) {
                    let infoDict = info as NSDictionary
                    if infoDict.count > 0 {
                        currentNetwork = infoDict[kCNNetworkInfoKeySSID as String] as? String
                        return
                    }
                }
            }
        }

I have tried NEHotspotHelper.supportedNetworkInterfaces() instead, but this always returns an empty array. (I have not added any additional entitlements.)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!